The interface can follow that of vibe:
--- build.d ---
import std.experimental.build;

Build myBuild(){ ... }

mixin BuildMain!(myBuild);
---

Then
$ rdmd build.d
 - compile and run the script, which builds the project by default
$ rdmd build.d -ninja
 - the script run with -ninja switch only generates ninja scipt
$ rdmd build.d -make
 - same, but generates make script
$ rdmd --build-only build.d
- compiles the script, which can then be run with whatever switches you want

Reply via email to