From cb3628f47537348e574ab257094febaae690eef1 Mon Sep 17 00:00:00 2001 From: vieira-andre Date: Mon, 20 Jul 2020 10:15:26 -0300 Subject: [PATCH] Get rid of fody --- .gitignore | 4 +-- Attributes/ExecutionTimeMeasuredAttribute.cs | 36 -------------------- FodyWeavers.xsd | 26 ++++++++++++++ Mycenae.csproj | 1 - Tasks/EndToEnd.cs | 2 -- Tasks/Extraction.cs | 2 -- Tasks/Insertion.cs | 2 -- 7 files changed, 27 insertions(+), 46 deletions(-) delete mode 100644 Attributes/ExecutionTimeMeasuredAttribute.cs create mode 100644 FodyWeavers.xsd diff --git a/.gitignore b/.gitignore index 90d9c70..a7813b6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,4 @@ .vs/ bin/ obj/ -*.sln -*.xml -*.xsd \ No newline at end of file +*.sln \ No newline at end of file diff --git a/Attributes/ExecutionTimeMeasuredAttribute.cs b/Attributes/ExecutionTimeMeasuredAttribute.cs deleted file mode 100644 index 9aa3f3a..0000000 --- a/Attributes/ExecutionTimeMeasuredAttribute.cs +++ /dev/null @@ -1,36 +0,0 @@ -using MethodDecorator.Fody.Interfaces; -using NLog; -using System; -using System.Diagnostics; -using System.Reflection; - -namespace Mycenae.Attributes -{ - [AttributeUsage(AttributeTargets.Method)] - public class ExecutionTimeMeasuredAttribute : Attribute, IMethodDecorator - { - private readonly ILogger _logger = LogManager.GetCurrentClassLogger(); - private Stopwatch _stopwatch; - - public void Init(object instance, MethodBase method, object[] args) - { - } - - public void OnEntry() - { - _stopwatch = Stopwatch.StartNew(); - } - - public void OnException(Exception exception) - { - } - - public void OnExit() - { - _stopwatch.Stop(); - - _logger.Info($"Time elapsed: {_stopwatch.Elapsed.Hours}h:{_stopwatch.Elapsed.Minutes}m:" + - $"{_stopwatch.Elapsed.Seconds}s:{_stopwatch.Elapsed.Milliseconds}ms"); - } - } -} diff --git a/FodyWeavers.xsd b/FodyWeavers.xsd new file mode 100644 index 0000000..241a5a9 --- /dev/null +++ b/FodyWeavers.xsd @@ -0,0 +1,26 @@ + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Mycenae.csproj b/Mycenae.csproj index 31f172e..912bc5b 100644 --- a/Mycenae.csproj +++ b/Mycenae.csproj @@ -8,7 +8,6 @@ - diff --git a/Tasks/EndToEnd.cs b/Tasks/EndToEnd.cs index df32a3b..2da1fd4 100644 --- a/Tasks/EndToEnd.cs +++ b/Tasks/EndToEnd.cs @@ -1,5 +1,4 @@ using Cassandra; -using Mycenae.Attributes; using Mycenae.Models; using NLog; using System; @@ -12,7 +11,6 @@ internal class EndToEnd : MigrationTask { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - [ExecutionTimeMeasured] internal override void Execute() { Logger.Info("Starting end-to-end migration..."); diff --git a/Tasks/Extraction.cs b/Tasks/Extraction.cs index a6f171f..fc099fe 100644 --- a/Tasks/Extraction.cs +++ b/Tasks/Extraction.cs @@ -1,5 +1,4 @@ using Cassandra; -using Mycenae.Attributes; using Mycenae.Models; using NLog; using System; @@ -14,7 +13,6 @@ internal class Extraction : MigrationTask { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - [ExecutionTimeMeasured] internal override void Execute() { Logger.Info("Starting extraction phase..."); diff --git a/Tasks/Insertion.cs b/Tasks/Insertion.cs index 3762c45..6c278cb 100644 --- a/Tasks/Insertion.cs +++ b/Tasks/Insertion.cs @@ -1,6 +1,5 @@ using Cassandra; using CsvHelper; -using Mycenae.Attributes; using Mycenae.Converters; using Mycenae.Models; using NLog; @@ -17,7 +16,6 @@ internal class Insertion : MigrationTask { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - [ExecutionTimeMeasured] internal override void Execute() { Logger.Info("Starting insertion phase...");