Build the UnifyBuild .NET project using the UnifyBuild.Tool dotnet tool and NUKE build system. Use when building, compiling, packing NuGet packages, or running any build-related tasks for this project.
This skill provides instructions for building the UnifyBuild project using its own build tooling.
UnifyBuild is a reusable build tooling system based on NUKE that ships as a dotnet tool (UnifyBuild.Tool). The project builds itself using its own tooling (dogfooding).
UnifyBuild.Tool (dotnet local tool)build/build.config.jsondotnet/UnifyBuild.slnUnifyBuild.Nuke - Library for NUKE build scriptsUnifyBuild.Tool - Dotnet tool that runs build targetsBefore building, ensure dotnet tools are restored:
dotnet tool restore
This installs the local UnifyBuild.Tool defined in .config/dotnet-tools.json.
Build all projects without creating packages:
dotnet tool run unify-build -- Compile --configuration Release
Or using the shorter alias:
dotnet unify-build Compile --configuration Release
Build and create NuGet packages for distribution:
dotnet unify-build PackProjects --configuration Release
This is the most common build command. It:
build/_artifacts/{version}/flat/--configuration Release - Release build (optimized, default)--configuration Debug - Debug build (with symbols)The build is controlled by build/build.config.json:
{
"$schema": "./build.config.schema.json",
"versionEnv": "GITVERSION_MAJORMINORPATCH",
"artifactsVersion": "0.1.10",
"projectGroups": {
"packages": {
"sourceDir": "dotnet/src",
"action": "pack",
"include": ["UnifyBuild.Nuke", "UnifyBuild.Tool"]
}
},
"packIncludeSymbols": true,
"syncLocalNugetFeed": true,
"localNugetFeedRoot": "build/_artifacts"
}
Key settings:
dotnet/src)The UnifyBuild tool supports these targets:
Compile - Build all projectsPackProjects - Build and create NuGet packagesPublishHosts - Publish executable/host projectsPublishPlugins - Publish plugin/runtime library projectsPublishProjects - Publish explicit projects from configSyncLatestArtifacts - Sync artifacts to latest folderBuild artifacts are placed in:
build/_artifacts/
├── {version}/ # Version-specific artifacts (e.g., 0.1.10)
│ └── flat/ # NuGet packages (.nupkg, .snupkg)
└── latest/ # Symlinked to latest version (after SyncLatestArtifacts)
The project includes a Taskfile.yml with convenient task shortcuts:
# Using task runner (if installed)
task nuke:compile
task nuke:pack-projects
task dogfood
However, the direct dotnet commands are preferred as they don't require task runner installation.
The project builds itself using its own tooling:
# Build the tool packages
dotnet unify-build PackProjects --configuration Release
# Verify the build output
# (Manual verification or run build/verify-dogfood.ps1 on Windows)
If dotnet unify-build fails with "tool not found":
dotnet tool restore
Ensure all NuGet packages are restored:
dotnet restore dotnet/UnifyBuild.sln
To perform a clean build, remove build artifacts first:
# Windows
Remove-Item -Recurse -Force build/_artifacts
# Unix
rm -rf build/_artifacts
Then run the build command again.
Most common workflow for building this project:
# 1. Restore tools
dotnet tool restore
# 2. Build and pack
dotnet unify-build PackProjects --configuration Release
# 3. Check output
ls build/_artifacts/0.1.10/flat/
Expected output:
UnifyBuild.Nuke.{version}.nupkgUnifyBuild.Tool.{version}.nupkg