View all files | ||||
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.
Add the package to your NUKE build project, usually build/_build.csproj:
Then import the namespace in Build.cs:
| 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. |
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:
The demo uses samples/Demo/Demo.slnx and its NUKE build prints project filters from this package before building and testing the sample graph.
The repository uses TUnit with Microsoft Testing Platform. global.json opts dotnet test into the MTP runner for .NET 10 SDKs:
MIT. See LICENSE.