Build Setup
After installing the NUKE global tool, you can call it from anywhere on your machine to set up a new build:
nuke :setup
Preferably, you should run the setup from inside an existing repository. NUKE will search for the next upwards .git
or .svn
directory to determine the build root directory. If neither is found, it will use the current directory. You can also pass the --root
parameter to specify that the current directory should be used as a root directory.
During the setup, you'll be asked several questions to configure your build to your preferences:
Use Space to pause/play, โฌ and โฎ to seek backward/forward, or F to fullscreen.
Congratulations! ๐ฅณ Your first build has now been set up, and you can run the build with the default implementation!
Effective Changesโ
The setup will create a number of files in your repository and โ if you've chosen so โ add the build project to your solution file. Below, you can examine the structure of added files and what they are used for:
<root-directory>
โโโ .nuke # Root directory marker
โ โโโ build.schema.json # Build schema file
โ โโโ parameters.json # Default parameters file
โ
โโโ build
โ โโโ .editorconfig # Common formatting
โ โโโ _build.csproj # Build project file
โ โโโ _build.csproj.DotSettings # ReSharper/Rider formatting
โ โโโ Build.cs # Default build implementation
โ โโโ Directory.Build.props # MSBuild stop files
โ โโโ Directory.Build.targets
โ
โโโ build.cmd # Cross-platform bootstrapping
โโโ build.ps1 # Windows/PowerShell bootstrapping
โโโ build.sh # Linux/Shell bootstrapping
If you prefer, you may choose to delete any of the bootstrapping scripts, MSBuild stop files, or formatting settings. For instance, when you're sure that no other MSBuild files will interfere with the build project, or you don't rely on either Roslyn or ReSharper/Rider for formatting. However, note that the bootstrapping scripts play an essential role in CI/CD environments, and are also used for the configuration generation feature.
Project Structureโ
While you can enjoy writing most build-relevant logic inside your build console applications, there is still a large number of files involved in the general process of build automation. NUKE organizes these files in different folders as linked files in the build project for you:
- Config
- CI/CD
- Bootstrappers
- MSBuildย AutoโImports
<root-directory>
โโโ .nuke
โ โโโ parameters.json # Parameters files
โ โโโ parameters.*.json
โ
โโโ GitVersion.yml # GitVersion configuration
โโโ global.json # SDK version
โโโ nuget.config # NuGet feeds configuration
โโโ version.json # Nerdbank GitVersioning configuration
<root-directory>
โโโ .github
โ โโโ workflows # GitHub Actions
โ โโโ *.yml
โ
โโโ .teamcity # TeamCity
โ โโโ settings.kts
โ
โโโ .gitlab-ci.yml # GitLab CI
โโโ .space.kts # JetBrains Space
โโโ .travis.yml # Travis CI
โโโ appveyor.yml # AppVeyor
โโโ appveyor.*.yml
โโโ azure-pipelines.yml # Azure Pipelines
โโโ azure-pipelines.*.yml
โโโ bitrise.yml # Bitrise
<root-directory>
โโโ build.cmd # Cross-platform
โโโ build.ps1 # Windows/PowerShell
โโโ build.sh # Linux/Shell
<root-directory>
โโโ **
โโโ Directory.Build.props
โโโ Directory.Build.targets
You can deactivate linking of the above files by removing the NukeRootDirectory
and NukeScriptDirectory
properties from the build project file.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- <NukeRootDirectory>..</NukeRootDirectory> -->
<!-- <NukeScriptDirectory>..</NukeScriptDirectory> -->
</PropertyGroup>
</Project>