We define a simple model, consisting of a cactus-project and a site.
- cactus-project. Defines the root directory of a project.
- site. Defines a directory as a collection of compilable targets.
This allows us to easily define projects separately, and merge them together by
colocating them under a new cactus-project without needing to modify them at
all.
Internally, we use a few more concepts:
-
target, a unit of work within the project file tree with a specific input, output, and an associated rule go generate the output from the input (such as "make a directory" or "compile markdown to html"). -
rule, a description of how atargetshould be evaluated.
Note: this nomenclature is heavily inspired by Bazel
-
Look for
cactus-projectfile in the current folder, to find the top of the directory tree. If nocactus-projectis present, bail immediately. -
Traverse that tree, looking for
sitefiles to identify directories that should be compiled. -
For each
site, find all thetargetsand build a dependency graph with it. -
For each
target, execute their associatedrule.