Skip to content

Commit 62ae086

Browse files
committed
Conditional verbosity when packing packages based on the .NET SDK version
1 parent a7f5dc0 commit 62ae086

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tools/builder/common

tools/builder/targets/Packages.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ public static async Task OnExecute(BuildContext context)
2323
.GetFiles(srcFolder, "*.nuspec", SearchOption.AllDirectories)
2424
.ToList();
2525

26+
// You can't see the created package name in .NET 9+ SDK without doing detailed verbosity
27+
var verbosity =
28+
context.DotNetSdkVersion.Major <= 8
29+
? context.Verbosity.ToString()
30+
: "detailed";
31+
2632
// Pack the .nuspec file(s)
2733
foreach (var nuspecFile in nuspecFiles.OrderBy(x => x))
28-
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)}");
34+
await context.Exec("dotnet", $"pack --nologo --no-build --configuration {context.ConfigurationText} --output {context.PackageOutputFolder} --verbosity {verbosity} \"{Path.GetDirectoryName(nuspecFile)}\" -p:NuspecFile={Path.GetFileName(nuspecFile)}");
2935
}
3036
}

0 commit comments

Comments
 (0)