just
is a command runner, like make.
To setup the justfile, symlink or copy it into the bitcoin core source code's parent directory, e.g.:
# With bitcoin core in this directory:
# /home/user/src/core/bitcoin
# and this repo at:
# /home/user/srcbitcoin-dev-tools/dotfiles
ln -s /home/user/src/bitcoin-dev-tools/dotfiles/justfile /home/user/src/core
The justfile contains the working-dir
directive so that it will execute recipes in the bitcoin core source directory.
set working-directory := "bitcoin"
This setup permits running git clean -dfx
style cleans.
If you prefer you can symlink the justfile directly into the source directory and remove the working-directory
option.
You may then like to add the justfile to the ignored git files:
# ignore .justfile with git without using .gitignore
echo ".justfile" >> ~/src/bitcoin/.git/info/exclude
List commands with just
(or just --list
).
Add your own commands or contribute them back upstream here. See the manual for syntax and features.
Make sure to install the completions for your shell!
Typical usage for a user of this justfile might be:
-
Show main dependencies for your OS, installing them per the instructions:
just show-deps
-
(optional) Install the python dependencies needed for linting:
just install-python-deps
-
Compile the current branch with default configuration:
just build
-
Check all tests are passing:
just test
-
Run linters:
just lint
-
Make some changes to the code...
-
Check all new commits in the branch are good, shortcut to run
just check
on each new commit in the branch vs master:just prepare
-
Run a CI stage locally:
just ci ci/test/00_setup_env_native_tidy.sh