noxfile
Tasks for the
work around builds.
noxfile is optional and separate from nox.build. Use it for named project tasks, not for declaring compilation targets.
Preferred syntax
A small YAML-like task map.
tasks:
format:
run: cargo fmt --all
rebuild:
@nox clean
@nox build
package:
@nox rebuild
run: cargo build --releaseRun a named task with nox task format. A repeated run: executes commands in order.
Task catalog
Small commands, composed.
These are example tasks. Your noxfile can define any commands you need for your project workflow.
format
Format the project.
cargo fmt --allcheck
Run a project check.
cargo checkrebuild
Compose existing Nox commands.
@nox clean + @nox buildLegacy syntax
Older blocks still work.
task "format" {
run = "cargo fmt --all"
}
task "check" {
run = "cargo check"
}On Unix, Nox executes task commands through sh -c. On Windows it uses windows-shell when configured, otherwise cmd /C.
Interpolation
Use project context.
tasks:
package:
run: mkdir -p {{build_dir}}
run: echo version={{version}}{{version}} is the project version and {{build_dir}} is the selected build directory. Task arguments, outputs, and parallel scheduling are not implemented.