-
Notifications
You must be signed in to change notification settings - Fork 5
/
justfile
47 lines (36 loc) · 1.48 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Find the target directory
CARGO_TARGET := `cargo metadata --format-version 1 --no-deps | jq -r '.target_directory'`
export ASPD_EXEC := CARGO_TARGET / "debug" / "aspd"
export BARK_EXEC := CARGO_TARGET / "debug" / "bark"
precheck CHECK:
bash contrib/prechecks.sh {{CHECK}}
prechecks:
just precheck rust_no_spaces_for_indent
just precheck unused_aspd_logs
check:
cargo check --all --tests
checks: prechecks check
build:
cargo build --workspace
docker-pull:
if [ -n "${LIGHTNINGD_DOCKER_IMAGE-""}" ]; then docker pull "$LIGHTNINGD_DOCKER_IMAGE"; fi
alias unit := test-unit
test-unit TEST="":
cargo test --workspace --exclude ark-testing {{TEST}}
alias int := test-integration
test-integration TEST="": build docker-pull
cargo test --package ark-testing {{TEST}}
test: test-unit test-integration
RUSTDOCSDIR := justfile_directory() / "rustdocs"
DEFAULT_CRATE := "bark" # This is opinionated, but doesn't matter. Any page has full search.
# Generate rustdoc documentation for all crates and dependencies
rustdocs:
mkdir -p {{RUSTDOCSDIR}}
cargo doc --target-dir {{RUSTDOCSDIR}} --locked --all --lib --examples --document-private-items
echo "Open Rust docs at file://{{RUSTDOCSDIR}}/doc/{{DEFAULT_CRATE}}/index.html"
# cleans most of our crates, doesn't clean grpc gens, they are sometimes slow to build
clean:
cargo clean -p ark-lib -p ark-testing -p bark-aspd -p bark-client -p bark-json -p aspd-log
# run a single clippy lint
clippy LINT:
cargo clippy -- -A clippy::all -W clippy::{{LINT}}