<Message Text="Packages found in $(LibrariesShippingPackagesDir): @(_BuiltNuGets)" Importance="Low" />
<InstallWorkloadFromArtifacts
- WorkloadId="@(WorkloadIdForTesting)"
+ WorkloadIds="@(WorkloadIdForTesting)"
VersionBand="$(SdkBandVersion)"
LocalNuGetsPath="$(LibrariesShippingPackagesDir)"
TemplateNuGetConfigPath="$(RepoRoot)NuGet.config"
Outputs="$(SdkWithNoWorkload_WorkloadStampPath)">
<InstallWorkloadFromArtifacts
- WorkloadId="@(WorkloadIdForTesting)"
+ WorkloadIds="@(WorkloadIdForTesting)"
VersionBand="$(SdkBandVersion)"
LocalNuGetsPath="$(LibrariesShippingPackagesDir)"
TemplateNuGetConfigPath="$(RepoRoot)NuGet.config"
"description": ".NET WebAssembly build tools",
"packs": [
"Microsoft.NET.Runtime.WebAssembly.Sdk",
- "Microsoft.NET.Runtime.WebAssembly.Templates",
"Microsoft.NETCore.App.Runtime.Mono.browser-wasm",
"Microsoft.NETCore.App.Runtime.AOT.Cross.browser-wasm"
],
"extends": [ "microsoft-net-runtime-mono-tooling", "microsoft-net-sdk-emscripten" ],
"platforms": [ "win-x64", "linux-x64", "osx-x64", "osx-arm64" ]
},
+ "wasm-experimental": {
+ "description": ".NET WebAssembly experimental",
+ "packs": [
+ "Microsoft.NET.Runtime.WebAssembly.Templates"
+ ],
+ "extends": [ "wasm-tools" ],
+ "platforms": [ "win-x64", "linux-x64", "osx-x64", "osx-arm64" ]
+ },
"microsoft-net-runtime-android": {
"abstract": true,
"description": "Android Mono Runtime",
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
+using System.Globalization;
using System.IO;
using System.Linq;
-using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.Build.Framework;
public class InstallWorkloadFromArtifacts : Task
{
[Required, NotNull]
- public ITaskItem? WorkloadId { get; set; }
+ public ITaskItem[] WorkloadIds { get; set; } = Array.Empty<ITaskItem>();
[Required, NotNull]
public string? VersionBand { get; set; }
{
try
{
- return ExecuteInternal();
+ foreach (var workloadIdItem in WorkloadIds)
+ {
+ if (!ExecuteInternal(workloadIdItem))
+ return false;
+ }
+ return true;
}
catch (LogAsErrorException laee)
{
}
}
- private bool ExecuteInternal()
+ private bool ExecuteInternal(ITaskItem workloadId)
{
- if (!HasMetadata(WorkloadId, nameof(WorkloadId), "Version") ||
- !HasMetadata(WorkloadId, nameof(WorkloadId), "ManifestName"))
+ if (!HasMetadata(workloadId, nameof(workloadId), "Version") ||
+ !HasMetadata(workloadId, nameof(workloadId), "ManifestName"))
{
return false;
}
return false;
}
- Log.LogMessage(MessageImportance.High, $"{Environment.NewLine}** Installing workload manifest {WorkloadId.ItemSpec} **{Environment.NewLine}");
+ Log.LogMessage(MessageImportance.High, $"{Environment.NewLine}** Installing workload manifest {workloadId.ItemSpec} **{Environment.NewLine}");
string nugetConfigContents = GetNuGetConfig();
- if (!InstallWorkloadManifest(WorkloadId.GetMetadata("ManifestName"), WorkloadId.GetMetadata("Version"), nugetConfigContents, stopOnMissing: true))
+ if (!InstallWorkloadManifest(workloadId, workloadId.GetMetadata("ManifestName"), workloadId.GetMetadata("Version"), nugetConfigContents, stopOnMissing: true))
return false;
if (OnlyUpdateManifests)
(int exitCode, string output) = Utils.TryRunProcess(
Log,
Path.Combine(SdkDir, "dotnet"),
- $"workload install --skip-manifest-update --no-cache --configfile \"{nugetConfigPath}\" {WorkloadId.ItemSpec}",
+ $"workload install --skip-manifest-update --no-cache --configfile \"{nugetConfigPath}\" {workloadId.ItemSpec}",
workingDir: Path.GetTempPath(),
silent: false,
debugMessageImportance: MessageImportance.High);
return contents.Replace(s_nugetInsertionTag, $@"<add key=""nuget-local"" value=""{LocalNuGetsPath}"" />");
}
- private bool InstallWorkloadManifest(string name, string version, string nugetConfigContents, bool stopOnMissing)
+ private bool InstallWorkloadManifest(ITaskItem workloadId, string name, string version, string nugetConfigContents, bool stopOnMissing)
{
Log.LogMessage(MessageImportance.High, $"Installing workload manifest for {name}/{version}");
{
foreach ((string depName, string depVersion) in manifest.DependsOn)
{
- if (!InstallWorkloadManifest(depName, depVersion, nugetConfigContents, stopOnMissing: false))
+ if (!InstallWorkloadManifest(workloadId, depName, depVersion, nugetConfigContents, stopOnMissing: false))
{
- Log.LogWarning($"Could not install manifest {depName}/{depVersion}. This can be ignored if the workload {WorkloadId.ItemSpec} doesn't depend on it.");
+ Log.LogWarning($"Could not install manifest {depName}/{depVersion}. This can be ignored if the workload {workloadId.ItemSpec} doesn't depend on it.");
continue;
}
}
+ $"{Environment.NewLine}Using the first one: {first}");
}
- return first ?? Path.Combine(parentDir, dirName);
+ return first ?? Path.Combine(parentDir, dirName.ToLower(CultureInfo.InvariantCulture));
}
private sealed record ManifestInformation(