From be29069762db31f08ddc465a996a3a7e68799323 Mon Sep 17 00:00:00 2001 From: WMJ Date: Tue, 18 May 2021 14:42:41 +0800 Subject: [PATCH] Added option to skip merging config files --- ILRepack/Application.cs | 1 + ILRepack/ILRepack.cs | 5 ++++- ILRepack/RepackOptions.cs | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ILRepack/Application.cs b/ILRepack/Application.cs index 0568f594..7ec5df30 100644 --- a/ILRepack/Application.cs +++ b/ILRepack/Application.cs @@ -67,6 +67,7 @@ static void Usage() Console.WriteLine(@" - /allowMultiple when copyattrs is specified, allows multiple attributes (if type allows)"); Console.WriteLine(@" - /target:kind specify target assembly kind (library, exe, winexe supported, default is same as first assembly)"); Console.WriteLine(@" - /targetplatform:P specify target platform (v1, v1.1, v2, v4 supported)"); + Console.WriteLine(@" - /skipconfig skips merging config files"); Console.WriteLine(@" - /xmldocs merges XML documentation as well"); Console.WriteLine(@" - /lib: adds the path to the search directories for referenced assemblies (can be specified multiple times)"); Console.WriteLine(@" - /internalize sets all types but the ones from the first assembly 'internal'"); diff --git a/ILRepack/ILRepack.cs b/ILRepack/ILRepack.cs index b0388eb3..6db80f24 100644 --- a/ILRepack/ILRepack.cs +++ b/ILRepack/ILRepack.cs @@ -368,7 +368,10 @@ public void Repack() Options.StrongNameLost = true; // nice to have, merge .config (assembly configuration file) & .xml (assembly documentation) - ConfigMerger.Process(this); + if (Options.SkipConfigMerge == false) + { + ConfigMerger.Process(this); + } if (Options.XmlDocumentation) DocumentationMerger.Process(this); } diff --git a/ILRepack/RepackOptions.cs b/ILRepack/RepackOptions.cs index b45cd37b..c522f730 100644 --- a/ILRepack/RepackOptions.cs +++ b/ILRepack/RepackOptions.cs @@ -70,6 +70,7 @@ public string ExcludeFile public IEnumerable SearchDirectories { get; set; } public bool UnionMerge { get; set; } public Version Version { get; set; } + public bool SkipConfigMerge { get; set; } public bool XmlDocumentation { get; set; } // end of ILMerge-similar attributes @@ -219,6 +220,7 @@ void Parse() var version = cmd.Option("ver"); if (!string.IsNullOrEmpty(version)) Version = new Version(version); + SkipConfigMerge = cmd.Modifier("skipconfig"); XmlDocumentation = cmd.Modifier("xmldocs"); NoRepackRes = cmd.Modifier("norepackres"); KeepOtherVersionReferences = cmd.Modifier("keepotherversionreferences");