;doc: merge/update just/make/shake dev docs
This commit is contained in:
parent
9e8f8b42e1
commit
81d67a1dd1
37
doc/JUST-MAKE-SHAKE.md
Normal file
37
doc/JUST-MAKE-SHAKE.md
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# Just, make, and Shake
|
||||||
|
|
||||||
|
After many years of using on GNU 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 it is worthwhile, even though, for now, it is usually not installed by default and it lacks Make's file dependency tracking.
|
||||||
|
When dependency tracking, or more powerful code, is really needed, we typically use [[SHAKE|Shake.hs]] instead of make or just.
|
||||||
|
|
||||||
|
`Justfile` in the main repo's top directory is where we keep the recipes (scripts);
|
||||||
|
this is the starting point for automating hledger project tasks.
|
||||||
|
Install and run `just` to see the list of recipes. I suggest using a shorter command alias `j`.
|
||||||
|
Eg:
|
||||||
|
|
||||||
|
```cli
|
||||||
|
$ alias j=just
|
||||||
|
$ j # list all scripts
|
||||||
|
$ j h test # list scripts mentioning "test"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Make
|
||||||
|
|
||||||
|
[GNU Make](https://www.gnu.org/software/make) makefiles are still used in a number of subdirectories - site, finance etc.
|
||||||
|
|
||||||
|
## Shake
|
||||||
|
|
||||||
|
`Shake.hs` in the main repo's top directory complements the Justfile;
|
||||||
|
it is used for tasks requiring file dependencies or more complex code, such as building documentation and the web site.
|
||||||
|
Eg:
|
||||||
|
|
||||||
|
```cli
|
||||||
|
$ ./Shake.hs # compile it for speed and git branch independence. Or: just Shake
|
||||||
|
$ ./Shake # list scripts
|
||||||
|
```
|
||||||
|
|
||||||
|
## tools
|
||||||
|
|
||||||
|
Additional helper scripts and tools can be found in the `tools/` subdirectory.
|
||||||
40
doc/MAKE.md
40
doc/MAKE.md
@ -1,40 +0,0 @@
|
|||||||
# Make
|
|
||||||
|
|
||||||
A Makefile is provided to make common developer tasks easy to remember,
|
|
||||||
and to insulate us a little from the ever-evolving Haskell tools ecosystem.
|
|
||||||
Using it is entirely optional, but recommended.
|
|
||||||
You'll need [GNU Make](https://www.gnu.org/software/make) installed.
|
|
||||||
|
|
||||||
The Makefile contains a fair amount of obsolete cruft and needs cleanup. Some tasks (docs, website) are now handled by the [Shake](#shake) file instead.
|
|
||||||
|
|
||||||
The Makefile is self-documenting. Run `make` to see a list of the main make rules:
|
|
||||||
|
|
||||||
```cli
|
|
||||||
$ make
|
|
||||||
Makefile:37: -------------------- hledger make rules --------------------
|
|
||||||
Makefile:39: make [help] -- list documented rules in this makefile. make -n RULE shows more detail.
|
|
||||||
Makefile:204: (INSTALLING:)
|
|
||||||
Makefile:206: make install -- download dependencies and install hledger executables to ~/.local/bin or equivalent (with stack)
|
|
||||||
Makefile:231: (BUILDING:)
|
|
||||||
Makefile:235: make build -- download dependencies and build hledger executables (with stack)
|
|
||||||
Makefile:304: make hledgerdev -- quickly build the hledger executable (with ghc and -DDEVELOPMENT)
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
To see what a make rule will do without actually doing it, use the `-n` flag:
|
|
||||||
|
|
||||||
```cli
|
|
||||||
$ make build -n
|
|
||||||
stack build
|
|
||||||
```
|
|
||||||
```cli
|
|
||||||
$ make test -n
|
|
||||||
(stack test \
|
|
||||||
&& echo pkgtest PASSED) || echo pkgtest FAILED
|
|
||||||
(stack exec hledger test \
|
|
||||||
&& echo builtintest PASSED) || echo builtintest FAILED
|
|
||||||
(COLUMNS=80 PATH=`pwd`/bin:/home/simon/src/hledger/bin:/home/simon/.local/bin:/home/simon/.cabal/bin:/opt/ghc/7.10.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/var/lib/gems/1.9.1/bin stack exec -- shelltest --execdir -- -j16 --hide-successes tests \
|
|
||||||
&& echo functest PASSED) || echo functest FAILED
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
13
doc/SHAKE.md
13
doc/SHAKE.md
@ -1,13 +0,0 @@
|
|||||||
# Shake
|
|
||||||
|
|
||||||
`Shake.hs` in the top directory complements the Makefile; it is used for some more complex tasks, such as building documentation and the web site.
|
|
||||||
|
|
||||||
Compile it:
|
|
||||||
|
|
||||||
./Shake.hs # or, make Shake
|
|
||||||
|
|
||||||
See help:
|
|
||||||
|
|
||||||
./Shake
|
|
||||||
|
|
||||||
|
|
||||||
@ -27,14 +27,13 @@ and then symlinked into the hledger_site repo for rendering on hledger.org.
|
|||||||
- [FINANCE](FINANCE.md)
|
- [FINANCE](FINANCE.md)
|
||||||
- [Investment Accounting Feature Ladder](investment-accounting-features.md)
|
- [Investment Accounting Feature Ladder](investment-accounting-features.md)
|
||||||
- [ISSUES](ISSUES.md)
|
- [ISSUES](ISSUES.md)
|
||||||
|
- [JUST-MAKE-SHAKE](JUST-MAKE-SHAKE.md)
|
||||||
- [LINKS](LINKS.md)
|
- [LINKS](LINKS.md)
|
||||||
- [MAKE](MAKE.md)
|
|
||||||
- [MOCKUPS](MOCKUPS.md)
|
- [MOCKUPS](MOCKUPS.md)
|
||||||
- [PULLREQUESTS](PULLREQUESTS.md)
|
- [PULLREQUESTS](PULLREQUESTS.md)
|
||||||
- [REGRESSIONS](REGRESSIONS.md)
|
- [REGRESSIONS](REGRESSIONS.md)
|
||||||
- [RELEASING](RELEASING.md)
|
- [RELEASING](RELEASING.md)
|
||||||
- [REPOS](REPOS.md)
|
- [REPOS](REPOS.md)
|
||||||
- [SHAKE](SHAKE.md)
|
|
||||||
- [TESTS](TESTS.md)
|
- [TESTS](TESTS.md)
|
||||||
- [VERSIONNUMBERS](VERSIONNUMBERS.md)
|
- [VERSIONNUMBERS](VERSIONNUMBERS.md)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user