From 62ae086cb53576c39c60a0018769233061c3525c Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 13 Nov 2024 12:06:38 -0800 Subject: [PATCH] Conditional verbosity when packing packages based on the .NET SDK version --- tools/builder/common | 2 +- tools/builder/targets/Packages.cs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/builder/common b/tools/builder/common index 90dba1f..a18f4b7 160000 --- a/tools/builder/common +++ b/tools/builder/common @@ -1 +1 @@ -Subproject commit 90dba1f5638a4f00d4978a73e23edde5b85061d9 +Subproject commit a18f4b754f6317ceadb0d5a00441aaab5f396d34 diff --git a/tools/builder/targets/Packages.cs b/tools/builder/targets/Packages.cs index ca32564..d3c86d0 100644 --- a/tools/builder/targets/Packages.cs +++ b/tools/builder/targets/Packages.cs @@ -23,8 +23,14 @@ public static async Task OnExecute(BuildContext context) .GetFiles(srcFolder, "*.nuspec", SearchOption.AllDirectories) .ToList(); + // You can't see the created package name in .NET 9+ SDK without doing detailed verbosity + var verbosity = + context.DotNetSdkVersion.Major <= 8 + ? context.Verbosity.ToString() + : "detailed"; + // Pack the .nuspec file(s) foreach (var nuspecFile in nuspecFiles.OrderBy(x => x)) - await context.Exec("dotnet", $"pack --nologo --no-build --configuration {context.ConfigurationText} --output {context.PackageOutputFolder} --verbosity {context.Verbosity} \"{Path.GetDirectoryName(nuspecFile)}\" -p:NuspecFile={Path.GetFileName(nuspecFile)}"); + await context.Exec("dotnet", $"pack --nologo --no-build --configuration {context.ConfigurationText} --output {context.PackageOutputFolder} --verbosity {verbosity} \"{Path.GetDirectoryName(nuspecFile)}\" -p:NuspecFile={Path.GetFileName(nuspecFile)}"); } }