Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateo Torres-Ruiz <mateoatr@users.noreply.github.com>2020-03-10 14:21:13 +0300
committerGitHub <noreply@github.com>2020-03-10 14:21:13 +0300
commit1798652e6b6b26c5dd3b374c6a9ca700c5adb15a (patch)
tree8fc9e7c14982952a30087b7e44650e3ddf4ab910 /test/Mono.Linker.Tests.Cases/CommandLine
parentb2f8980a6628a97bc907704890e76462be7aac0d (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.cs22
-rw-r--r--test/Mono.Linker.Tests.Cases/CommandLine/Dependencies/CustomStepDummy.cs14
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.");
+ }
+ }
+}