From 1f810e528da0ef01f7867816f26aee56bbefa2a1 Mon Sep 17 00:00:00 2001 From: Nikolay Pianikov Date: Fri, 30 Aug 2024 12:08:05 +0300 Subject: [PATCH] Improved build --- build/CompatibilityCheckTarget.cs | 14 ++++++++++++-- build/DeployTarget.cs | 1 + build/GeneratorTarget.cs | 6 +++--- build/LibrariesTarget.cs | 1 + 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/build/CompatibilityCheckTarget.cs b/build/CompatibilityCheckTarget.cs index 45b0ada6..dce341d8 100644 --- a/build/CompatibilityCheckTarget.cs +++ b/build/CompatibilityCheckTarget.cs @@ -91,9 +91,13 @@ private async Task CompatibilityCheckAsync( tempDirectory, "--force", "-f", framework) + .WithShortName($"create project from the dilib template for {framework}") .RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); - await new DotNetRestore().WithWorkingDirectory(tempDirectory).RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); + await new DotNetRestore() + .WithShortName($"restore project for {framework}") + .WithWorkingDirectory(tempDirectory) + .RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); if (!framework.Contains('.')) { @@ -102,6 +106,7 @@ private async Task CompatibilityCheckAsync( Path.Combine(tempDirectory), "package", "Microsoft.NETFramework.ReferenceAssemblies") + .WithShortName($"add package Microsoft.NETFramework.ReferenceAssemblies for {framework}") .RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); } @@ -114,9 +119,11 @@ private async Task CompatibilityCheckAsync( settings.NextVersion.ToString(), "-s", Path.GetDirectoryName(generatorPackage)!) + .WithShortName($"add the package {generatorPackage} for {framework}") .RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); await new DotNetBuild().WithWorkingDirectory(tempDirectory) + .WithShortName($"build sample project for {framework}") .RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); } finally @@ -147,6 +154,7 @@ private async Task CompatibilityCheckAsync(string generatorPackage, Library libr tempDirForFramework, "--force", "-f", framework) + .WithShortName($"create project from the {templateName} template for {framework}") .RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); await new DotNetCustom( @@ -161,6 +169,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}") .RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); var libraryPackageDir = Path.GetDirectoryName(library.Package.Path)!; @@ -178,6 +187,7 @@ private async Task CompatibilityCheckAsync(string generatorPackage, Library libr libraryPackageDir, "-f", framework) + .WithShortName($"add package {library.Name} for the {templateName} template for {framework}") .RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); await new DotNetRestore() @@ -188,9 +198,9 @@ private async Task CompatibilityCheckAsync(string generatorPackage, Library libr .RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); await new DotNetBuild() - .WithShortName($"Build for compatibility check of {framework} for template {templateName}") .WithWorkingDirectory(tempDirForFramework) .WithNoRestore(true) + .WithShortName($"build for the {templateName} template for {framework}") .RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); } } diff --git a/build/DeployTarget.cs b/build/DeployTarget.cs index b272ca1e..bd30853b 100644 --- a/build/DeployTarget.cs +++ b/build/DeployTarget.cs @@ -25,6 +25,7 @@ public async Task RunAsync(CancellationToken cancellationToken) await new DotNetNuGetPush() .WithSources("https://api.nuget.org/v3/index.json") .WithPackage(package.Path).WithApiKey(settings.NuGetKey) + .WithShortName($"pushing {package.Path}") .BuildAsync(cancellationToken: cancellationToken).EnsureSuccess(); } diff --git a/build/GeneratorTarget.cs b/build/GeneratorTarget.cs index b618aa52..ed8cf08b 100644 --- a/build/GeneratorTarget.cs +++ b/build/GeneratorTarget.cs @@ -72,12 +72,12 @@ private async Task CreateGeneratorPackageAsync(CodeAnalysis codeAnalysis } await new DotNetBuild() - .WithShortName($"Building {codeAnalysis.AnalyzerRoslynPackageVersion}") + .WithShortName($"building {codeAnalysis.AnalyzerRoslynPackageVersion}") .WithProps(props) .BuildAsync(cancellationToken: cancellationToken).EnsureSuccess(); await new DotNetTest() - .WithShortName($"Testing {codeAnalysis.AnalyzerRoslynPackageVersion}") + .WithShortName($"testing {codeAnalysis.AnalyzerRoslynPackageVersion}") .WithProps(props) .WithConfiguration(settings.Configuration) .WithNoBuild(true).WithNoLogo(true) @@ -86,7 +86,7 @@ private async Task CreateGeneratorPackageAsync(CodeAnalysis codeAnalysis var packagePath = Path.Combine(PackagesDir, analyzerRoslynVersion.ToString()); await new DotNetPack() - .WithShortName($"Packing {codeAnalysis.AnalyzerRoslynPackageVersion}") + .WithShortName($"packing {codeAnalysis.AnalyzerRoslynPackageVersion}") .WithProps(props) .WithConfiguration(settings.Configuration) .WithNoBuild(true) diff --git a/build/LibrariesTarget.cs b/build/LibrariesTarget.cs index 70c24a08..c5aaeee7 100644 --- a/build/LibrariesTarget.cs +++ b/build/LibrariesTarget.cs @@ -51,6 +51,7 @@ public async Task> RunAsync(CancellationToken cance ("version", settings.NextVersion.ToString())) .WithConfiguration(settings.Configuration).WithNoBuild(true).WithNoLogo(true) .WithProject(Path.Combine(Path.GetFullPath(Path.Combine("src", library.Name)), $"{library.Name}.csproj")) + .WithShortName($"packing {library.Name}") .BuildAsync(cancellationToken: cancellationToken).EnsureSuccess(); }