Skip to content

Commit

Permalink
disabled CompileTimeMethodInfos because of test errors. Not all tests…
Browse files Browse the repository at this point in the history
… were covered with the optimization.
  • Loading branch information
dd committed Oct 18, 2021
1 parent 4853cd5 commit a801966
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/MethodBoundaryAspect.Fody/ModuleWeaver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public ModuleWeaver()
InitLogging();
}

public bool DisableCompileTimeMethodInfos { get; set; }
public bool DisableCompileTimeMethodInfos { get; set; } = true;

public int TotalWeavedTypes { get; private set; }
public int TotalWeavedMethods { get; private set; }
Expand All @@ -52,12 +52,7 @@ public ModuleWeaver()

public override void Execute()
{
_methodInfoCompileTimeWeaver = new MethodInfoCompileTimeWeaver(ModuleDefinition);
_methodInfoCompileTimeWeaver.IsEnabled = !DisableCompileTimeMethodInfos;

Execute(ModuleDefinition);

_methodInfoCompileTimeWeaver.Finish();
}

public override IEnumerable<string> GetAssembliesForScanning()
Expand Down Expand Up @@ -149,10 +144,17 @@ private void InitLogging()

private void Execute(ModuleDefinition module)
{
_methodInfoCompileTimeWeaver = new MethodInfoCompileTimeWeaver(module)
{
IsEnabled = !DisableCompileTimeMethodInfos
};

var assemblyMethodBoundaryAspects = module.Assembly.CustomAttributes;

foreach (var type in module.Types.ToList())
WeaveTypeAndNestedTypes(module, type, assemblyMethodBoundaryAspects);

_methodInfoCompileTimeWeaver.Finish();
}

private void WeaveTypeAndNestedTypes(ModuleDefinition module, TypeDefinition type,
Expand Down

0 comments on commit a801966

Please sign in to comment.