Permalink
Browse files

Merge pull request #174 from hazzik/attributes-cleanup

Do not "clean up" attributes when we copy attributes from the main assembly
  • Loading branch information...
2 parents 5a447f3 + 8759f15 commit 22540d910e76b05664e97342ae797109c90471ee @gluck committed on GitHub Nov 28, 2016
Showing with 7 additions and 2 deletions.
  1. +7 −2 ILRepack/Steps/AttributesRepackStep.cs
@@ -59,6 +59,7 @@ public void Perform()
_repackCopier.CopyCustomAttributes(mod.CustomAttributes, targetAssemblyMainModule.CustomAttributes, _options.AllowMultipleAssemblyLevelAttributes, null);
}
CleanupAttributes();
+ RemoveAttributes();
}
else if (_options.AttributeFile != null)
{
@@ -72,18 +73,22 @@ public void Perform()
_repackCopier.CopyCustomAttributes(_repackContext.PrimaryAssemblyDefinition.CustomAttributes, targetAssemblyDefinition.CustomAttributes, null);
_repackCopier.CopyCustomAttributes(_repackContext.PrimaryAssemblyMainModule.CustomAttributes, targetAssemblyMainModule.CustomAttributes, null);
// TODO: should copy Win32 resources, too
- CleanupAttributes();
+ RemoveAttributes();
}
_repackCopier.CopySecurityDeclarations(_repackContext.PrimaryAssemblyDefinition.SecurityDeclarations, targetAssemblyDefinition.SecurityDeclarations, null);
}
- void CleanupAttributes()
+ private void CleanupAttributes()
{
CleanupAttributes(typeof(CompilationRelaxationsAttribute).FullName, x => x.ConstructorArguments.Count == 1 /* TODO && x.ConstructorArguments[0].Value.Equals(1) */);
CleanupAttributes(typeof(SecurityTransparentAttribute).FullName, _ => true);
CleanupAttributes(typeof(SecurityCriticalAttribute).FullName, x => x.ConstructorArguments.Count == 0);
CleanupAttributes(typeof(AllowPartiallyTrustedCallersAttribute).FullName, x => x.ConstructorArguments.Count == 0);
CleanupAttributes(typeof(SecurityRulesAttribute).FullName, x => x.ConstructorArguments.Count == 0);
+ }
+
+ private void RemoveAttributes()
+ {
RemoveAttributes<InternalsVisibleToAttribute>(ca =>
{
String name = (string)ca.ConstructorArguments[0].Value;

0 comments on commit 22540d9

Please sign in to comment.