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 5c60a82 commit 71f53fc
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
Submodule common updated 1 files
+21 −0 models/BuildContext.cs
8 changes: 7 additions & 1 deletion tools/builder/targets/Packages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ public static async Task OnExecute(BuildContext context)
foreach (var packageFile in packageFiles)
File.Delete(packageFile);

await context.Exec("dotnet", $"pack --nologo --no-build --configuration {context.ConfigurationText} --output {context.PackageOutputFolder} --verbosity {context.Verbosity} src/xunit.analyzers -p:NuspecFile=xunit.analyzers.nuspec");
// 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";

await context.Exec("dotnet", $"pack --nologo --no-build --configuration {context.ConfigurationText} --output {context.PackageOutputFolder} --verbosity {verbosity} src/xunit.analyzers -p:NuspecFile=xunit.analyzers.nuspec");
}
}

0 comments on commit 71f53fc

Please sign in to comment.