build
Generate code for a multi-file Vexil project with imports.
Usage
vexilc build <root.vexil> --include <dir> --output <dir> [--target <target>]
Options
| Option | Default | Description |
|---|---|---|
--include <dir> | (none) | Directory to search for imported schemas (can be repeated) |
--output <dir> | (required) | Output directory for generated code |
--target <target> | rust | Code generation target: rust, typescript, or go |
Example
vexilc build protocol.vexil \
--include ./schemas \
--output ./generated \
--target rust
Output:
wrote ./generated/common/types.rs
wrote ./generated/protocol.rs
build complete: 3 schemas compiled
How it works
- Parses the root schema file
- Discovers
importstatements and resolves them against--includedirectories - Compiles all schemas in topological order (dependencies before dependents)
- Generates one output file per namespace, with cross-file references handled by the backend
- Handles diamond dependencies by deduplicating shared imports