Implementation notes

March 16, 2026 ยท View on GitHub

This file keeps high level technical notes about Xake internals.

Build model

Xake scripts define rules for targets. During execution, the engine records dependencies and stores build state in .xake.

A target is rebuilt when at least one condition is true:

  • output does not exist
  • dependency files changed
  • dependency target was rebuilt
  • variable or environment dependency changed
  • recipe requests rerun by alwaysRerun

Dependency storage

The build database stores:

  • target graph
  • requested dependencies
  • file list snapshots from filesets
  • variable and environment reads

This enables incremental rebuild and --dryrun estimation.

Rules and scheduling

  • <== demands dependencies in parallel
  • <<< demands dependencies in sequence
  • worker count defaults to CPU core count and can be overridden by -t

Parallel execution still respects dependency order.

Filesets

Filesets support Ant style masks, recursive **, and named match groups in rule patterns.

Common behavior:

  • path separators / and \\ are accepted
  • file list result is tracked as dependency input
  • change in resolved file list can trigger rebuild

Recipe behavior

recipe computation supports standard control flow and async style composition with do! and let!.

Notes:

  • do! works in with blocks
  • do! does not work in finally blocks due to F# computation expression limits
  • WhenError, FailWhen, and CheckErrorLevel are available for explicit error flow

Logging

Xake supports console and file logging with separate verbosity levels.

Log levels:

  • Silent
  • Quiet
  • Normal
  • Loud
  • Chatty
  • Diag

Runtime and platform

The current repository targets modern dotnet workflow with .NET SDK 9.0+.

Legacy Mono and .NET Framework details from older versions are intentionally excluded from this document.

Teardown behavior

Teardown rules are defined in script and run during shutdown when engine mode calls StopAsync.

In CLI script mode, teardown targets are carried through options and may require explicit demand depending on run mode.