public IEnumerable <VisualStudioDependency> GetAliasedDependencies(WorkloadPack pack)
        {
            foreach (var rid in pack.AliasTo.Keys)
            {
                switch (rid)
                {
                case "win-x86":
                case "win-x64":
                    yield return(new VisualStudioDependency($"{pack.AliasTo[rid].ToString().Replace(ShortNames)}.{pack.Version}", new NuGetVersion(pack.Version).Version));

                    break;

                default:
                    break;
                }
            }
        }
        /// <summary>
        /// Gets the packages associated with a specific workload pack.
        /// </summary>
        /// <param name="pack"></param>
        /// <returns>An enumerable of tuples. Each tuple contains the full path of the NuGet package and the target platforms.</returns>
        internal IEnumerable <(string, string[])> GetSourcePackages(WorkloadPack pack)
        {
            if (pack.IsAlias)
            {
                foreach (string rid in pack.AliasTo.Keys)
                {
                    string sourcePackage = Path.Combine(PackagesPath, $"{pack.AliasTo[rid]}.{pack.Version}.nupkg");

                    switch (rid)
                    {
                    case "win7":
                    case "win10":
                    case "win":
                    case "any":
                        yield return(sourcePackage, SupportedPlatforms);

                        break;

                    case "win-x64":
                        yield return(sourcePackage, new[] { "x64" });

                        break;

                    case "win-x86":
                        yield return(sourcePackage, new[] { "x86" });

                        break;

                    case "win-arm64":
                        yield return(sourcePackage, new[] { "arm64" });

                        break;

                    default:
                        Log?.LogMessage($"Skipping alias ({rid}).");
                        continue;
                    }
                }
            }
            else
            {
                // For non-RID specific packs we'll produce MSIs for each supported platform.
                yield return(Path.Combine(PackagesPath, $"{pack.Id}.{pack.Version}.nupkg"), SupportedPlatforms);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Add a dependency using the specified workload pack.
 /// </summary>
 /// <param name="dependency">The dependency to add to this component.</param>
 public void AddDependency(WorkloadPack dependency)
 {
     AddDependency($"{dependency.Id}", new NuGetVersion(dependency.Version).Version);
 }
 /// <summary>
 /// Add a dependency using the specified workload pack.
 /// </summary>
 /// <param name="pack">The dependency to add to this component.</param>
 public void AddDependency(WorkloadPack pack)
 {
     AddDependency($"{pack.Id.ToString().Replace(ShortNames)}.{pack.Version}", new NuGetVersion(pack.Version).Version, maxVersion: null);
 }