Project Structure
RSConstruct follows a convention-over-configuration approach. The directory layout determines how files are processed.
Directory layout
project/
├── rsconstruct.toml # Configuration file
├── .rsconstructignore # Glob patterns for files to exclude
├── config/ # Python config files (loaded by templates)
├── tera.templates/ # .tera template files
├── templates.mako/ # .mako template files
├── src/ # C/C++ source files
├── plugins/ # Lua processor plugins (.lua files)
├── out/
│ ├── cc_single_file/ # Compiled executables
│ ├── ruff/ # Ruff lint stub files
│ ├── pylint/ # Pylint lint stub files
│ ├── cppcheck/ # C/C++ lint stub files
│ ├── spellcheck/ # Spellcheck stub files
│ └── make/ # Make stub files
└── .rsconstruct/ # Cache directory
├── index.json # Cache index
├── objects/ # Cached build artifacts
└── deps/ # Dependency files
Conventions
Templates
Files in tera.templates/ with configured extensions (default .tera) are rendered to the project root:
tera.templates/Makefile.teraproducesMakefiletera.templates/config.toml.teraproducesconfig.toml
Similarly, files in templates.mako/ with .mako extensions are rendered via the Mako processor:
templates.mako/Makefile.makoproducesMakefiletemplates.mako/config.toml.makoproducesconfig.toml
C/C++ sources
Files in the source directory (default src/) are compiled to executables under out/cc_single_file/, preserving the directory structure:
src/main.cproducesout/cc_single_file/main.elfsrc/utils/helper.ccproducesout/cc_single_file/utils/helper.elf
Python files
Python files are linted and stub outputs are written to out/ruff/ (ruff processor) or out/pylint/ (pylint processor).
Build artifacts
All build outputs go into out/. The cache lives in .rsconstruct/. Use rsconstruct clean to remove out/ (preserving cache) or rsconstruct clean all to remove both.