hledger/doc/JUST-MAKE-SHAKE.md

37 lines
1.4 KiB
Markdown
Raw Normal View History

2024-05-01 20:21:04 +03:00
# Just, Make, Shake
2024-04-24 21:54:46 +03:00
After many years of relying on [GNU Make](https://www.gnu.org/software/make) for automating project tasks,
we now primarily use [just](https://github.com/casey/just) instead.
`just` is better enough, and clean consolidated efficient project automation is so valuable, that this is worthwhile -
even though `just` requires installing and lacks Make's file dependency tracking, for now.
`Justfile` in the main repo's top directory is the starting point for scripts automating hledger project tasks.
Install and run `just` to list them. I suggest using a shorter command alias `j`. Eg:
```cli
$ alias j=just
$ j # list all scripts
$ j h test # list scripts mentioning "test"
```
2024-04-24 21:54:46 +03:00
Makefiles are still used in a number of subdirectories, like `site/` and `finance/`.
## Shake
2024-04-24 21:42:49 +03:00
`Shake.hs` in the main repo's top directory complements the Justfile.
Tasks requiring file dependencies and/or more complex code, such as building documentation and the web site,
are usually scripted here, often with a corresponding alias in `Justfile`.
Eg:
```cli
$ ./Shake.hs # compile it for speed and git branch independence. Or: just Shake
$ ./Shake # list scripts
2024-04-24 21:54:46 +03:00
$ j site # runs the `just site` which calls `./Shake site` to do the work
2024-04-24 21:42:49 +03:00
$ j -n site # just --dry-run, show the commands that `just site` will run
```
## tools
2024-04-24 21:42:49 +03:00
Additional helper scripts and tools are kept in the `tools/` subdirectory.