Skip to content

Reference | Settings

olegz edited this page Mar 16, 2026 · 2 revisions

Script settings

Settings are specified as operations inside the xakeScript computation expression.

do xakeScript {
    filelog "build.log" Diag
    consolelog Verbosity.Quiet
    var "NETFX" "4.5"
    want ["build"]
    varschema vars

    rules [ ... ]
}

Operations

rules

Adds multiple rules at once. Can be used multiple times.

rules [
    "main" <== ["build"]
    "clean" => rm {dir "out"}
]

rule

Adds a single rule.

rule ("clean" => rm {dir "out"})

phony

Shorthand for adding a phony rule.

phony "hello" (recipe { do! trace Message "Hi!" })

want

Defines the default target list. Overridden by command-line targets if any are specified.

want ["main"]

wantOverride

Sets the target list unconditionally, ignoring command-line targets.

wantOverride ["build"; "test"]

var

Defines a script variable value.

var "VERSION" "1.0.0"

varschema

Registers a typed variable schema for --help output and recipe binding. See Variables.

varschema vars

filelog

Sets the log file name and verbosity level.

filelog "build.log" Diag
filelog "errors.log" Verbosity.Chatty

consolelog

Sets the console output verbosity. Default is Normal.

consolelog Verbosity.Diag
consolelog Verbosity.Quiet

rootdir

Sets the project root directory. All relative paths in rules and filesets resolve from this directory. Defaults to the current working directory.

rootdir "/tmp/build"

dryrun

Enables dry-run mode — Xake displays the dependency graph and time estimates without executing rules. Same as --dryrun CLI flag.

dryrun

noPersist

Disables the .xake build database. Every target always rebuilds. Useful for engine mode or CI builds where persistence is not needed.

noPersist

teardown

Registers targets to execute during XakeEngine.StopAsync. See Engine.

teardown ["cleanup"; "report"]

Verbosity levels

Level Description
Silent No output
Quiet Errors only
Normal Default — errors, warnings, commands
Loud Adds info messages
Chatty Adds debug messages
Diag Everything including verbose traces

Clone this wiki locally