Build Execution
After you've set up a build you can run it either through the global tool or one of the installed bootstrapping scripts:
- Global Tool
- Windows
- Linux
nuke [arguments]
.\build.cmd [arguments]
./build.sh [arguments]
This document discusses the default build arguments (also referred to as parameters). You will learn how to define custom parameters in a following chapter.
The global tool makes running builds a lot easier. Once you've configured the shell completion, you can enter arguments much faster and avoid any typos. It also allows you to run a build from anywhere below the root directory without having to go back to where the bootstrapping scripts are located.
Build Summaryβ
Once a build has finished running an execution plan, it will print a comprehensive summary with all involved targets, their outcome, duration, and additional metadata:
βββββββββββββββββββββββββββββββββββββββ
Target Status Duration
βββββββββββββββββββββββββββββββββββββββ
Restore Succeeded 0:16
Compile Succeeded 0:59 // Version: 5.3.0-alpha.35
Test Succeeded 0:41 // Passed: 327, Skipped: 6
Pack Succeeded 0:10 // Packages: 4
βββββββββββββββββββββββββββββββββββββββ
Total 2:08
βββββββββββββββββββββββββββββββββββββββ
Build succeeded on 12/17/2024, 12:18:25 AM. οΌΌοΌοΌΎα΄οΌΎοΌοΌ
Invoking Targetsβ
You can invoke a single target or a set of targets either through positional or named arguments:
- Positional Argument
- Named Argument
nuke <target> [other-targets...]
nuke [arguments...] --targets <target> [other-targets...]
Passing targets as named arguments allows you to quickly overwrite the invoked targets without moving the caret to the front of a long invocation command.
Skipping Targetsβ
You can skip all or individual targets from the execution plan that are not specifically invoked:
- Skipping All Targets
- Skipping Individual Targets
nuke [targets] --skip
nuke [targets] --skip <other-targets...>
Skipping targets can greatly improve your troubleshooting experience. Irrelevant targets won't waste execution time, and there is no need to temporarily change dependencies between targets.
Aborting Buildsβ
At any moment during execution, you can hit Ctrl-C
to abort the build with a SIGINT signal. Targets that were running at the time will be marked with the Aborted
status:
βββββββββββββββββββββββββββββββββββββββ
Target Status Duration
βββββββββββββββββββββββββββββββββββββββ
Restore Succeeded 0:16
Compile Aborted 0:01
Pack NotRun
βββββββββββββββββββββββββββββββββββββββ
Total 0:17
βββββββββββββββββββββββββββββββββββββββ
Continuing Buildsβ
You can continue a failed or aborted build from the first point of failure:
nuke [arguments...] --continue
All previously succeeded targets will be skipped automatically, which can save a lot of unnecessary execution time:
βββββββββββββββββββββββββββββββββββββββ
Target Status Duration
βββββββββββββββββββββββββββββββββββββββ
Restore Skipped
Compile Succeeded 0:15
Pack Succeeded 0:05
βββββββββββββββββββββββββββββββββββββββ
Total 0:20
βββββββββββββββββββββββββββββββββββββββ
When you combine the --continue
argument with the dotnet watch
command, you can establish a very tight feedback loop while working on your target implementation. Just go to the build project directory and call:
dotnet watch run -- [arguments..] --continue
The state of the build instance is NOT serialized. I.e., if a succeeded target produced data for a failed target, that data won't be available during the continuation of the build.
Moreover, a build can only reliably continue when the invocation is the same as in the previous attempt. That means that you can only add the --continue
switch but not change any other arguments. If this rule is violated, the build will start from the very beginning.
Help Textβ
When you're coming back to a repository or build you haven't worked on in a while, you can bring up the integrated help text by calling:
nuke --help
This allows you to inspect all available targets with their direct dependencies as well as parameters with their descriptions:
Targets (with their direct dependencies):
Clean
Restore
Compile (default) -> Restore
Parameters:
--configuration Configuration to build - Default is 'Debug' (local) or
'Release' (server).
--continue Indicates to continue a previously failed build attempt.
--help Shows the help text for this build assembly.
--host Host for execution. Default is 'automatic'.
--no-logo Disables displaying the NUKE logo.
--plan Shows the execution plan (HTML).
--profile Defines the profiles to load.
--root Root directory during build execution.
--skip List of targets to be skipped. Empty list skips all
dependencies.
--target List of targets to be invoked. Default is 'Compile'.
--verbosity Logging verbosity during build execution. Default is
'Normal'.
Execution Plansβ
In order to get a better understanding of how your builds are structured, you can load a visual representation of the different execution plans by calling:
nuke --plan
Hovering a target will show its individual execution plan, that means, all targets that are going to be executed when one specific target is invoked. The style of an edge (solid/dashed/yellow) between two targets indicates their dependency relation (execution/ordering/trigger):
When no targets are hovered, the execution plan for the default targets is highlighted.