Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ public string SuppressIces
set;
}

/// <summary>
/// Generate msis in parallel.
/// </summary>
public bool RunInParallel
{
get;
set;
} = true;

/// <summary>
/// The paths of the generated .swixproj files.
/// </summary>
Expand Down Expand Up @@ -182,6 +191,7 @@ internal IEnumerable<ITaskItem> GenerateMsisFromManifests(ITaskItem[] workloadMa
IntermediateBaseOutputPath = this.IntermediateBaseOutputPath,
OutputPath = this.OutputPath,
PackagesPath = this.PackagesPath,
RunInParallel = this.RunInParallel,
ShortNames = this.ShortNames,
SuppressIces = this.SuppressIces,
WixToolsetPath = this.WixToolsetPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ public string PackagesPath
set;
}

/// <summary>
/// Generate msis in parallel.
/// </summary>
public bool RunInParallel
{
get;
set;
} = true;

/// <summary>
/// Gets the set of missing workload packs.
/// </summary>
Expand Down Expand Up @@ -90,14 +99,24 @@ public override bool Execute()
string swixPackageId = $"{pack.Id.ToString().Replace(ShortNames)}.{pack.Version}";

// Always select the pack ID for the VS MSI package, even when aliased.
packsToGenerate.Add(new(sourcePackage, swixPackageId, OutputPath, pack.Kind, platforms));
if (RunInParallel)
{
packsToGenerate.Add(new(sourcePackage, swixPackageId, OutputPath, pack.Kind, platforms));
}
else
{
msis.AddRange(Generate(sourcePackage, swixPackageId, OutputPath, pack.Kind, platforms));
}
}
}

System.Threading.Tasks.Parallel.ForEach(packsToGenerate, p =>
if (RunInParallel)
{
msis.AddRange(Generate(p.sourcePackage, p.swixPackageId, p.outputPath, p.kind, p.platforms));
});
System.Threading.Tasks.Parallel.ForEach(packsToGenerate, p =>
{
msis.AddRange(Generate(p.sourcePackage, p.swixPackageId, p.outputPath, p.kind, p.platforms));
});
}

Msis = msis.ToArray();
MissingPacks = missingPacks.ToArray();
Expand Down