https://github.com/spectrevert/doze
A modulable and minimalist toy build system.
https://github.com/spectrevert/doze
build-system go
Last synced: 9 months ago
JSON representation
A modulable and minimalist toy build system.
- Host: GitHub
- URL: https://github.com/spectrevert/doze
- Owner: SpectreVert
- License: mit
- Created: 2022-03-12T21:40:19.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-09-06T00:55:57.000Z (10 months ago)
- Last Synced: 2025-09-06T02:37:32.172Z (10 months ago)
- Topics: build-system, go
- Language: Go
- Homepage:
- Size: 72.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Doze
A modulable and minimalist build system.
## Goals
- [X] Artifacts based
- [X] Easy to operate and to extend
- [ ] Only rebuild what is missing from disk (in progress)
- [ ] Support for expressing source and build directories (in progress)
- [ ] Local and remote build caches (todo)
- [ ] Daemon-mode with filesystem monitoring
## Design
Doze works with files on disk, which we call artifacts. It turns input artifacts into output artifacts following a build graph defined in a Dozefile. The inputs are turned into outputs following a user-defined procedure written directly in Go and embedded in the Doze binary.
A build can be triggered by running Doze manually from a terminal like it is usually the case with traditional build systems. Doze can also be launched in the background and left to monitor inputs of a project, automatically rebuilding only the parts that are affected by the operator/developer (not implemented yet).
## Usage
Doze does not implement a [DSL](https://en.wikipedia.org/wiki/Domain-specific_language) to configure its builds. Instead it uses a very simple `yaml` schema declared in a `Dozefile.yaml` file as described in the example below.
```yaml
rules:
- do: lang:c:object_file
inputs: [parse.c, parse.h]
outputs: [parse.o]
- do: lang:c:object_file
inputs: [main.c, parse.h]
outputs: [main.o]
- do: lang:c:executable
inputs: [parse.o, main.o]
outputs: [exe]
```
A rule defines a procedure to use, a set of input artifacts and a set of outputs. In this repository are provided two example procedures, `lang:c:object_file` and `lang:c:executable` to respectively build C object files and C executables. Their implementation is store in [procedures/lang_c/main.go](./procedures/lang_c/main.go). Registering a procedure in the `init` function of their modules embeds it directly in the Doze executable, given that the module of the procedure is included in the [Doze main module](./cli/main.go#L9).
There is no restriction on the order in which the rules are declared. Doze will only execute rules which are ready to execute; that is those which have all of their inputs ready for processing.