Clause
← All documentation

TOML projects

A project manifest selects ordered groups of Erlang sources and configures each target independently. All CLI actions accept projects. See the working example.

Manifest (schema 1)

schema_version = 1

[[targets]]
name = "app"
sources = ["main.erl", "src/workers/*.erl", "shared/**/*.erl"]
source_dirs = ["src/support"]
output = "build/app"
entry = "main:main"

[targets.options]
source_search_paths = ["src", "generated"]
include_dirs = ["include", "vendor/include"]
defines = ["DEBUG", "LIMIT=100", 'LABEL="demo"']
enable_features = ["maybe_expr"]
disable_features = ["compr_assign"]

[targets.options.applications]
my_dependency = "vendor/my_dependency"

CLI and target selection

clau [options] <source.erl>...
clau [options] --project <path> [--target <name>]...
clau --new-project <filename>

Each selected target is a separate compilation batch with its own preprocessing sessions. Planning (decode, select, discover, check output collisions) finishes before any source runs; execution then processes targets/files in order and latches failures. Payload output goes to stdout in target/file order without banners; context and diagnostics go to stderr.

./build/debug/bin/clau --parse-check --project examples/project/project.toml
./build/debug/bin/clau --print-ast --project examples/project/project.toml --target tests --target app

Executables

clau --project FILE [--target T]... (no --emit, no check/print action) links every selected target that has an output or entry key, or that CLI -o/--entry addresses, into one executable per target:

./build/debug/bin/clau --project tests/fixtures/linking/project/project.toml

Creating a project

--new-project <filename> writes one annotated manifest and nothing else.

Paths and discovery

Effective options

SettingManifest and CLI combination
include_dirsManifest order, after CLI -I (last CLI -I searched first)
source_search_pathsProject source lookup only
definesManifest first, then CLI; duplicates across both are errors
applicationsManifest map; CLI entries replace matching names
Feature listsManifest settings, then ordered CLI changes; CLI wins
outputPer target, executable targets only; CLI -o overrides for a single selected target
entryPer target; CLI --entry overrides for a single selected target

Build dependency

Compiler-private toml++ 3.4.0 (MIT), header-only with exceptions, unreleased syntax disabled. Archive SHA-256 8517f65938a4faae9ccf8ebb36631a38c1cadfb5efa85d9a72e15b9e97d25155.

Limits

Manifest size 1 MiB; at most 1,024 targets and 100,000 TOML nodes. Each source expansion allows 100,000 visited entries, 128 directory levels and 16,000,000 wildcard transitions. Exhaustion is an explicit error; these are work bounds, not I/O deadlines.