-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjustfile
95 lines (75 loc) · 2.56 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
#!/usr/bin/env -S just --justfile
# just (https://github.com/casey/just)
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
wasi_sdk_path := env_var("WASI_SDK_PATH")
list:
just --list
# cargo-sort (https://github.com/DevinR528/cargo-sort)
fmt:
cargo +nightly fmt
cargo sort -w
just --fmt --unstable
clippy:
cargo clippy
[unix]
test *TEST:
/usr/bin/env RUST_TEST_THREADS=1 cargo +nightly test --release -j 1 {{ TEST }}
[windows]
test *TEST:
#!powershell -NoLogo
$ENV:RUST_TEST_THREADS = "1"
cargo +nightly test --release -j 1 {{ TEST }}
build:
cargo build --release
# trunk (https://github.com/trunk-rs/trunk)
[unix]
build-wasm:
cd bff-gui
/usr/bin/env CC="{{ wasi_sdk_path }}/bin/clang --sysroot={{ wasi_sdk_path }}/share/wasi-sysroot" trunk build --release --no-default-features
# trunk (https://github.com/trunk-rs/trunk)
[windows]
build-wasm:
#!powershell -NoLogo
cd bff-gui
$ENV:CC = "{{ wasi_sdk_path }}/bin/clang --sysroot={{ wasi_sdk_path }}/share/wasi-sysroot"
trunk build --release --no-default-features
# trunk (https://github.com/trunk-rs/trunk)
[unix]
serve-wasm:
cd bff-gui
/usr/bin/env CC="{{ wasi_sdk_path }}/bin/clang --sysroot={{ wasi_sdk_path }}/share/wasi-sysroot" trunk serve --release --no-default-features
# trunk (https://github.com/trunk-rs/trunk)
[windows]
serve-wasm:
#!powershell -NoLogo
cd bff-gui
$ENV:CC = "{{ wasi_sdk_path }}/bin/clang --sysroot={{ wasi_sdk_path }}/share/wasi-sysroot"
trunk serve --release --no-default-features
doc:
cargo doc
run CMD *OPTIONS:
cargo run --release --bin {{ CMD }} -- {{ OPTIONS }}
install:
cargo install --path bff-cli --bin bff-cli
cargo install --path bff-gui --bin bff-gui
install-dev-deps:
rustup install nightly
rustup update nightly
cargo install cargo-sort
cargo install flamegraph
{{ if os() == 'windows' { 'cargo install blondie' } else { '' } }}
install-dev-deps-wasm:
rustup target add wasm32-unknown-unknown
cargo install trunk
# flamegraph (https://github.com/flamegraph-rs/flamegraph)
[unix]
flamegraph CMD *OPTIONS:
/usr/bin/env CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --root --release --bin {{ CMD }} -- {{ OPTIONS }}
# flamegraph (https://github.com/flamegraph-rs/flamegraph) and blondie (https://github.com/nico-abram/blondie)
[windows]
flamegraph CMD *OPTIONS:
#!powershell -NoLogo
$ENV:CARGO_PROFILE_RELEASE_DEBUG = "true"
$ENV:DTRACE = "blondie_dtrace"
cargo flamegraph --release --bin {{ CMD }} -- {{ OPTIONS }}
check: fmt clippy test