Build System Abstraction
Requirement
DIDP is designed to be tool-agnostic. The protocol should apply equally whether your project uses:
- TypeScript with Bun
- Swift with Xcode
- Python with Poetry
- Rust with Cargo
- Fish shell scripts
- Any other build system
Approach
Build Interface (Conceptual)
DIDP defines a conceptual Build Interface with these operations:
| Operation | Purpose |
|---|---|
configure | Set up build environment and dependencies |
build | Compile/transpile/bundle the project |
test | Run automated tests |
lint | Check code quality and style |
package | Create distributable artifacts |
Environment Selection
The concrete build backend can be selected via:
.envfile in project root- Environment variables (
$BUILD_SYSTEM, etc.) - Explicit configuration file
- Convention-based detection (presence of
package.json,Cargo.toml, etc.)
Default Implementation
When a concrete build backend is needed and none is specified, Ninja serves as the default/fallback example. This choice is:
- Illustrative, not prescriptive
- Used in documentation examples
- Not a requirement for DIDP adoption
Guidance
Do
- Keep DIDP phases independent of specific tools
- Document your project’s build system in
iteration_state.yaml - Use phase artifacts to capture build requirements
Don’t
- Bind DIDP concepts to specific build tool features
- Assume all projects use the same toolchain
- Require specific CI/CD platforms
Examples
TypeScript/Bun Project
# iteration_state.yaml
build_system:
type: bun
commands:
build: bun run build
test: bun test
lint: bun run lint
Swift/Xcode Project
# iteration_state.yaml
build_system:
type: xcode
commands:
build: xcodebuild -scheme MyApp
test: xcodebuild test -scheme MyApp
lint: swiftlint
Fish Shell Scripts
# iteration_state.yaml
build_system:
type: fish
commands:
build: ./build.fish
test: ./test.fish
lint: fish --no-execute *.fish
Summary
DIDP stays tool-agnostic by defining abstract operations rather than concrete commands. Projects implement these operations using their preferred toolchain, documented in project configuration.