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
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')
-rw-r--r--test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadaProvider.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadaProvider.cs b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadaProvider.cs
index cb0d855c8..32244f654 100644
--- a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadaProvider.cs
+++ b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadaProvider.cs
@@ -55,6 +55,16 @@ namespace Mono.Linker.Tests.TestCasesRunner {
{
var ca = additionalArgumentAttr.ConstructorArguments;
var values = ((CustomAttributeArgument [])ca [1].Value)?.Select (arg => arg.Value.ToString ()).ToArray ();
+ // Since custom attribute arguments need to be constant expressions, we need to add
+ // the path to the temp directory (where the custom assembly is located) here.
+ if ((string)ca [0].Value == "--custom-step") {
+ int pos = values [0].IndexOf (",");
+ if (pos != -1) {
+ string custom_assembly_path = values [0].Substring (pos + 1);
+ if (!Path.IsPathRooted (custom_assembly_path))
+ values [0] = values [0].Substring (0, pos + 1) + Path.Combine (inputPath, custom_assembly_path);
+ }
+ }
tclo.AdditionalArguments.Add (new KeyValuePair<string, string []> ((string)ca [0].Value, values));
}