-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
executable file
·78 lines (62 loc) · 1.72 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
alias f := fmt
alias b := build
alias c := clippy
alias t := test
alias r := run
alias d := doc
alias s := serve
alias p := prep
set windows-shell := ["cmd.exe", "/c"]
default:
@just --list --unsorted
# or: @just --choose
# Clean Cargo's `target` and mdbook's `book` folders
clean:
cargo clean
mdbook clean ./user_guide/
mdbook clean ./test_book/
# Format all code
fmt:
cargo +nightly fmt --all
# Check whether the code can compile
check:
cargo check --all-targets --locked
# `--all-targets`` is equivalent to specifying `--lib --bins --tests --benches --examples`.
# Build all code and books
build:
cargo build --all-targets --locked
mdbook build ./user_guide/
mdbook build ./test_book/
# `--all-targets`` is equivalent to specifying `--lib --bins --tests --benches --examples`.
# optional: --timings
# Scan all code for common mistakes
clippy:
cargo clippy --all-targets --locked
# Test all code and books
test:
cargo test --all-targets --locked
mdbook test ./user_guide/
mdbook test ./test_book/
# `--all-targets`` is equivalent to specifying `--lib --bins --tests --benches --examples`.
help := 'help'
empty := ''
# Run the tool
run cmd=help subcmd=empty:
cargo run --locked -- {{cmd}} {{subcmd}}
# Build and display the `cargo doc` documentation
[unix]
doc: _buildoc
cd /cargo-target-mdbook-utils/target/doc/ ; python3 -m http.server 9000
_buildoc:
cargo clean --doc
cargo doc --no-deps --locked # --document-private-items
# Display the user guide
serve:
mdbook serve ./user_guide/
# Run all the steps required before pushing code to GitHub
prep: fmt clean build clippy test _buildoc
## Utilities --------------------------------------
# Update Cargo.lock dependencies
[confirm]
update:
cargo update