diff options
author | Mateo Torres-Ruiz <mateoatr@users.noreply.github.com> | 2020-03-10 14:21:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-10 14:21:13 +0300 |
commit | 1798652e6b6b26c5dd3b374c6a9ca700c5adb15a (patch) | |
tree | 8fc9e7c14982952a30087b7e44650e3ddf4ab910 /test/Mono.Linker.Tests.Cases/CommandLine | |
parent | b2f8980a6628a97bc907704890e76462be7aac0d (diff) |
Resolve custom steps from external assemblies (#976)
* Resolve custom steps from external assemblies
* Preserve order of custom steps.
Add `--custom-assembly` command line option.
Updater src\linker readme.
* Remove GetCustomStepParams.
* Address fedback
* Remove --custom-assembly option
* Address Marek's feedback
* Fix the usage message to use single comma for assembly path separator
* Use single comma for assembly path separator
* Update test/Mono.Linker.Tests.Cases/CommandLine/AddCustomStep.cs
Co-Authored-By: Marek Safar <marek.safar@gmail.com>
Co-authored-by: Vitek Karas <vitek.karas@microsoft.com>
Co-authored-by: Marek Safar <marek.safar@gmail.com>
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/CommandLine')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/CommandLine/AddCustomStep.cs | 22 | ||||
-rw-r--r-- | test/Mono.Linker.Tests.Cases/CommandLine/Dependencies/CustomStepDummy.cs | 14 |
2 files changed, 36 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/CommandLine/AddCustomStep.cs b/test/Mono.Linker.Tests.Cases/CommandLine/AddCustomStep.cs new file mode 100644 index 000000000..9dde4df35 --- /dev/null +++ b/test/Mono.Linker.Tests.Cases/CommandLine/AddCustomStep.cs @@ -0,0 +1,22 @@ +using Mono.Linker.Tests.Cases.Expectations.Assertions; +using Mono.Linker.Tests.Cases.Expectations.Metadata; + +namespace Mono.Linker.Tests.Cases.CommandLine +{ + +#if !NETCOREAPP + [IgnoreTestCase ("Can be enabled once MonoBuild produces a dll from which we can grab the types in the Mono.Linker namespace.")] +#else + [SetupCompileBefore ("CustomStep.dll", new [] { "Dependencies/CustomStepDummy.cs" }, new [] { "illink.dll" })] +#endif + [SetupLinkerArgument ("--custom-step", "CustomStep.CustomStepDummy,CustomStep.dll")] + [SetupLinkerArgument ("--custom-step", "-CleanStep:CustomStep.CustomStepDummy,CustomStep.dll")] + [SetupLinkerArgument ("--custom-step", "+CleanStep:CustomStep.CustomStepDummy,CustomStep.dll")] + [LogContains ("Custom step added")] + public class AddCustomStep + { + public static void Main () + { + } + } +} diff --git a/test/Mono.Linker.Tests.Cases/CommandLine/Dependencies/CustomStepDummy.cs b/test/Mono.Linker.Tests.Cases/CommandLine/Dependencies/CustomStepDummy.cs new file mode 100644 index 000000000..8713dc2c1 --- /dev/null +++ b/test/Mono.Linker.Tests.Cases/CommandLine/Dependencies/CustomStepDummy.cs @@ -0,0 +1,14 @@ +using System; +using Mono.Linker; +using Mono.Linker.Steps; + +namespace CustomStep +{ + public class CustomStepDummy : IStep + { + public void Process(LinkContext context) + { + context.LogMessage ("Custom step added."); + } + } +} |