Skip to main content

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:

nuke [arguments]
info

This document discusses the default build arguments (also referred to as parameters). You will learn how to define custom parameters in a following chapter.

tip

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/4/2022, 7:52:47 PM. \(^ᴗ^)/

Invoking Targets

You can invoke a single target or a set of targets either through positional or named arguments:

nuke <target> [other-targets...]
tip

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:

nuke [targets] --skip
tip

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
═══════════════════════════════════════
tip

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
caution

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):

Visualizing Execution Plans

info

When no targets are hovered, the execution plan for the default targets is highlighted.