Skip to content

Commit

Permalink
Conditional verbosity when packing packages based on the .NET SDK ver…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
bradwilson committed Nov 13, 2024
1 parent a7f5dc0 commit 62ae086
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/builder/common
8 changes: 7 additions & 1 deletion tools/builder/targets/Packages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)}");
}
}

0 comments on commit 62ae086

Please sign in to comment.