forked from ark-bitcoin/bark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
60 lines (46 loc) · 2.12 KB
/
justfile
File metadata and controls
60 lines (46 loc) · 2.12 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
# Find the target directory
CARGO_TARGET := `cargo metadata --format-version 1 --no-deps | jq -r '.target_directory'`
JUSTFILE_DIR := justfile_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
[unix]
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"
[windows]
rustdocs:
set shell := ["cmd.exe"]
# Repetitive because I'm currently unable to create a named variable
# sed is converting C:\path\to\justfile_folder into /c/path/to/justfile_folder
mkdir -p $(echo "{{JUSTFILE_DIR}}" | sed 's|\\\\|/|g' | sed 's|^\([a-zA-Z]\):|/\L\1|')/rustdocs
cargo doc --target-dir $(echo "{{JUSTFILE_DIR}}" | sed 's|\\\\|/|g' | sed 's|^\([a-zA-Z]\):|/\L\1|')/rustdocs --locked --all --lib --examples --document-private-items
echo "Open Rust docs at file://$(echo "{{JUSTFILE_DIR}}" | sed 's|\\\\|/|g' | sed 's|^\([a-zA-Z]\):|/\L\1|')/rustdocs/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}}