CP.Nuke.BuildTools
3.0.2
dotnet add package CP.Nuke.BuildTools --version 3.0.2
NuGet\Install-Package CP.Nuke.BuildTools -Version 3.0.2
<PackageReference Include="CP.Nuke.BuildTools" Version="3.0.2" />
<PackageVersion Include="CP.Nuke.BuildTools" Version="3.0.2" />
<PackageReference Include="CP.Nuke.BuildTools" />
paket add CP.Nuke.BuildTools --version 3.0.2
#r "nuget: CP.Nuke.BuildTools, 3.0.2"
#:package CP.Nuke.BuildTools@3.0.2
#addin nuget:?package=CP.Nuke.BuildTools&version=3.0.2
#tool nuget:?package=CP.Nuke.BuildTools&version=3.0.2
CP.Nuke.BuildTools
CP.Nuke.BuildTools adds pragmatic helpers around NUKE for modern .NET cloud builds. The package tracks current Nuke.Common usage while filling gaps around .slnx discovery, project metadata, GitHub Actions output, and build automation ergonomics.
Install
Add the package to your NUKE build project, usually build/_build.csproj:
dotnet add build/_build.csproj package CP.Nuke.BuildTools
Then import the namespace in Build.cs:
using CP.BuildTools;
Current Focus
- TUnit tests running through Microsoft Testing Platform.
.slnx-aware solution discovery and project listing without replacing NUKE's own solution model.- Project metadata helpers for packable, test, executable, publishable, web, worker, Windows desktop, MAUI, container-enabled, target framework, runtime identifier, package reference, and project reference checks.
- Safer GitHub Actions helpers, including multiline-safe
GITHUB_OUTPUTwrites and escaped log annotations. - Cache key patterns that include
.slnx, solution files, project files, props/targets, package management, lock files, and NuGet config. - NUKE workload restore wrappers using
DotNetWorkloadRestoreinstead of ad hoc shell commands.
Common Helpers
| Method | Purpose |
|---|---|
PublicNuGetSource() |
Returns the public NuGet v3 source URL. |
ResolveSolutionFile(...) |
Finds a single .slnx/.sln, preferring .slnx when appropriate. |
DiscoverSolutionFiles(...) |
Lists solution files under a root directory. |
ListSolutionProjectPaths(...) |
Uses dotnet sln list for .slnx/.sln project paths. |
ReadProjectInfo(...) |
Reads SDK-style project metadata from a project file. |
ReadSolutionProjectInfos(...) |
Reads metadata for projects in a solution. |
GetPackableProjects() / GetTestProjects() |
Filters NUKE solution projects. |
GetPublishableProjectInfos() |
Finds publishable app-like projects from metadata. |
GitHubSetOutput() |
Writes single-line or multiline GitHub Actions outputs safely. |
GitHubActionsHashFilesExpression() |
Produces an Actions hashFiles(...) expression using modern cache inputs. |
RestoreProjectWorkload() / RestoreSolutionWorkloads() |
Runs dotnet workload restore through NUKE's DotNet wrapper. |
Example
[Solution] readonly Solution Solution = null!;
Target Info => _ => _
.Executes(() =>
{
var projectInfos = Solution.Path.ReadSolutionProjectInfos();
Log.Information("NuGet: {Source}", this.PublicNuGetSource());
Log.Information("Tests: {Projects}", string.Join(", ", Solution.GetTestProjects().Select(x => x.Name)));
Log.Information("Publishable: {Projects}", string.Join(", ", projectInfos.GetPublishableProjectInfos().Select(x => x.Name)));
});
Demo
A multi-project demo lives in samples/Demo. It includes Console, ASP.NET Web API, Blazor, Worker, gRPC, WPF, WinForms, MAUI Windows, Avalonia, a shared library, and TUnit tests.
Run it from the repository root:
dotnet run --project samples/Demo/build/_build.csproj -- --target Default
The demo uses samples/Demo/Demo.slnx and its NUKE build prints project filters from this package before building and testing the sample graph.
Test Platform
The repository uses TUnit with Microsoft Testing Platform. global.json opts dotnet test into the MTP runner for .NET 10 SDKs:
dotnet test src/CP.Nuke.BuildTools.slnx
Notes
Nuke.Commonremains the source of truth for solution/project loading; this package adds discovery and metadata helpers around it.- Methods that update Visual Studio, install SDKs/runtimes, call GitHub APIs, or upload release assets have external side effects and should be used intentionally in CI.
- The demo currently restores with an Avalonia transitive advisory warning for
Tmds.DBus.Protocolfrom the Avalonia package graph.
License
MIT. See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- NuGet.Packaging (>= 7.6.0)
- Nuke.Common (>= 10.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.2 | 238 | 5/16/2026 |
| 2.0.16 | 1,503 | 11/23/2025 |
| 1.0.94 | 1,883 | 1/16/2025 |
| 1.0.79 | 921 | 10/23/2024 |
| 1.0.44 | 2,708 | 1/22/2024 |
| 1.0.38 | 645 | 12/30/2023 |
| 1.0.36 | 554 | 12/4/2023 |
| 1.0.34 | 523 | 10/30/2023 |
| 1.0.32 | 564 | 9/25/2023 |
| 1.0.29 | 433 | 9/14/2023 |
| 1.0.14 | 637 | 7/29/2023 |
| 1.0.13 | 565 | 7/5/2023 |
| 1.0.9 | 458 | 6/25/2023 |
| 1.0.8 | 450 | 6/25/2023 |
| 1.0.7 | 453 | 6/25/2023 |
Compatability with Net 6 and net 7