Skip to content

Commit

Permalink
Parallel compatibility checks
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Aug 30, 2024
1 parent 1f810e5 commit 554de78
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions build/CompatibilityCheckTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,18 @@ public async Task<IReadOnlyCollection<Package>> RunAsync(CancellationToken cance
"net20"
];

foreach (var framework in frameworks.Reverse())
{
await CompatibilityCheckAsync(generatorPackage.Path, framework, cancellationToken);
}

var packages = new List<Package> { generatorPackage };

var tasks = new List<Task>();
tasks.AddRange(frameworks.Reverse().Select(framework => CompatibilityCheckAsync(generatorPackage.Path, framework, cancellationToken)));

// Libraries
var packages = new List<Package> { generatorPackage };
foreach (var library in libraries)
{
await CompatibilityCheckAsync(generatorPackage.Path, library, cancellationToken);
tasks.Add(CompatibilityCheckAsync(generatorPackage.Path, library, cancellationToken));
packages.Add(library.Package);
}

await Task.WhenAll(tasks);
return packages;
}

Expand Down Expand Up @@ -169,7 +167,7 @@ private async Task CompatibilityCheckAsync(string generatorPackage, Library libr
framework,
"-s",
Path.GetDirectoryName(generatorPackage)!)
.WithShortName($"add package Pure.DI for the {templateName} template for {framework}")
.WithShortName($"add package {generatorPackage} for the {templateName} template for {framework}")
.RunAsync(cancellationToken: cancellationToken).EnsureSuccess();

var libraryPackageDir = Path.GetDirectoryName(library.Package.Path)!;
Expand Down

0 comments on commit 554de78

Please sign in to comment.