CLI/Output: Add --separate-attributes option for assembly-level attributes

This commit is contained in:
Katy Coe
2020-01-19 02:59:59 +01:00
parent 7704c9f3d9
commit f71e065968
3 changed files with 49 additions and 24 deletions

View File

@@ -53,6 +53,9 @@ namespace Il2CppInspector
[Option('k', "must-compile", Required = false, HelpText = "Compilation tidying: try really hard to make code that compiles. Suppress generation of code for items with CompilerGenerated attribute. Comment out attributes without parameterless constructors or all-optional constructor arguments. Don't emit add/remove/raise on events. Specify AttributeTargets.All on classes with AttributeUsage attribute. Force auto-properties to have get accessors. Force regular properties to have bodies.")]
public bool MustCompile { get; set; }
[Option("separate-attributes", Required = false, HelpText = "Place assembly-level attributes in their own AssemblyInfo.cs files. Only used when layout is per-assembly or tree")]
public bool SeparateAssemblyAttributesFiles { get; set; }
}
// Adapted from: https://stackoverflow.com/questions/16376191/measuring-code-execution-time
@@ -143,10 +146,10 @@ namespace Il2CppInspector
break;
case ("assembly", "index"):
writer.WriteFilesByAssembly(csOut, t => t.Index);
writer.WriteFilesByAssembly(csOut, t => t.Index, options.SeparateAssemblyAttributesFiles);
break;
case ("assembly", "name"):
writer.WriteFilesByAssembly(csOut, t => t.Name);
writer.WriteFilesByAssembly(csOut, t => t.Name, options.SeparateAssemblyAttributesFiles);
break;
case ("class", _):
@@ -154,7 +157,7 @@ namespace Il2CppInspector
break;
case ("tree", _):
writer.WriteFilesByClassTree(csOut);
writer.WriteFilesByClassTree(csOut, options.SeparateAssemblyAttributesFiles);
break;
}