Projects and packages
A project is a directory with brass.project, a Brass file holding one
struct literal (so brass fmt and the editor work on it):
Project { name: "app" version: "0.1.0" deps: [ Dep { name: "geo", git: "https://example.com/geo", tag: "v1.0.0" }, ]}brass new <name>makesbrass.projectandsrc/main.brass;brass run,build,testandcheckwith no file usesrc/main.brass.brass add <name> <git url> <tag>records a dependency and fetches;brass fetchclones each package at its tag into a cache, follows the packages’ ownbrass.projectfiles, and keeps for each package the highest version anything asks for (minimal version selection: no solver, no surprise upgrades). It writesbrass.lockwith the exact commits.- Builds never touch the network: imports find packages through the lock
file, and a missing package says to run
brass fetch.fetchrefuses a tag that now points at a different commit than the lock recorded. import geoloads the package’ssrc/geo.brass;import geo.shapesloadssrc/shapes.brass. A package’s own imports stay inside it.brass.lockalso records a SHA-256 checksum over all of each package’s files.fetchrefuses a package whose files differ from the recorded sum for the same commit, and every build checks the cached copy against it, so a tampered cache or a rewritten tag is caught, not compiled.- A package is a git repository. A package index is a plain text file of
name git-urllines, found throughBRASS_INDEX(a file or an http(s) URL; default~/.config/brass/index.txt):brass add <name> <tag>looks the URL up there, andbrass search [word]lists entries. The index only maps names to repositories; the lock file’s commits and checksums are what make a build repeatable.