提交 33dbf989 编写于 作者: A Ankit Jain

PInvokeTableGenerator: Find path to WasmAppBuilder.dll at test time

.. instead of depending on *one* runtime pack version. This is needed
when we have more than one workload installed.
上级 1a731fb7
......@@ -462,9 +462,21 @@ public static void Main()
""";
string tasksDir = Path.Combine(s_buildEnv.WorkloadPacksDir,
"Microsoft.NET.Runtime.WebAssembly.Sdk",
s_buildEnv.GetRuntimePackVersion(DefaultTargetFramework),
"tasks");
if (!Directory.Exists(tasksDir))
throw new DirectoryNotFoundException($"Could not find tasks directory {tasksDir}");
string? taskPath = Directory.EnumerateFiles(tasksDir, "WasmAppBuilder.dll", SearchOption.AllDirectories)
.FirstOrDefault();
if (string.IsNullOrEmpty(taskPath))
throw new FileNotFoundException($"Could not find WasmAppBuilder.dll in {tasksDir}");
projectCode = projectCode
.Replace("###WasmPInvokeModule###", AddAssembly("System.Private.CoreLib") + AddAssembly("System.Runtime") + AddAssembly(libraryBuildArgs.ProjectName))
.Replace("###WasmAppBuilder###", Path.Combine(s_buildEnv.WorkloadPacksDir, "Microsoft.NET.Runtime.WebAssembly.Sdk", s_buildEnv.GetRuntimePackVersion(), "tasks", DefaultTargetFramework, "WasmAppBuilder.dll"));
.Replace("###WasmAppBuilder###", taskPath);
buildArgs = buildArgs with { ProjectName = $"icall_enum_{buildArgs.Config}_{id}", ProjectFileContents = projectCode };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册