-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
98 lines (78 loc) · 2.21 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# `Just a command runner` script
# Web: https://github.com/casey/just
# Man: https://just.systems/man/en/
#
# Generate Bash completion script:
# `just --completions bash > ~/.local/share/bash-completion/completions/just`
# and reload console
# by default (no params), list the recipes
default:
@just --list
alias b := build-dbg
alias br := build-rel
alias r := run-dbg
alias rr := run-rel
alias t := test
alias nx := nxtest
# build debug; eg: `just build-dbg `
build-dbg:
cargo build --example demo_full
cargo size --example demo_full -- -B
# build release
build-rel:
cargo build --release --example demo_full
cargo size --release --example demo_full -- -B
#
run-dbg:
clear
cargo run --example demo_full
run-rel:
clear
cargo run --release --example demo_full
# find out what functions takes most of the space in the library
bloat-lib:
cargo bloat --release --example demo_full --filter rtwins --no-relative-size -n 50
# find out what crates takes most of the space in the executable
bloat-demo:
cargo bloat --release --example demo_full --crates
# expand macros in demo <module>.rs
expand-demo *ARGS:
cargo expand --example demo_full {{ARGS}}
# expand macros in twins module
expand-lib *ARGS:
cargo expand --lib {{ARGS}}
# default tests runner
test:
clear
cargo test
# run tests using `nextest`
nxtest:
clear
cargo nextest run
# code coverage using tarpaulin
cover-tarp:
@cargo tarpaulin -V > /dev/null; [ $? -eq 0 ] || cargo install cargo-tarpaulin
cargo tarpaulin --out html --output-dir target/ --skip-clean --exclude-files "tests/*"
# vulnerabilities check
audit:
@cargo audit --version > /dev/null; [ $? -eq 0 ] || cargo install cargo-audit
cargo audit
# format using nightly (due to unstable rustfmt options)
fmt:
cargo +nightly fmt
# run Clippy linter
clip:
cargo clippy --no-deps
# debug locally
gdb:
# rust-gdb -tui -ex "b main" target/debug/examples/demo_full
cgdb -ex "b main" target/debug/examples/demo_full
# debug remote
gdb-remote:
rust-gdb -tui -ex "target remote :6789" -ex "b main" -ex "c"
# gdb server
gdb-server:
gdbserver :6789 target/debug/examples/demo_full
# project dependencies tree
tree:
cargo tree