-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.justfile
94 lines (70 loc) · 2.11 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
#!/usr/bin/env just --justfile
# Alias for `run`
default: (build-profile "dev")
# ---- Build Recipes ----
# Compile development build
alias build := build-profile
# Compile development build
alias build-dev := build-profile
# Compile release build
build-release: (build-profile "release" "")
# Compile build with specified profile
[private]
build-profile profile="dev" args="":
cargo build --bin froglight --profile {{profile}} {{args}}
# Run development build
alias run := run-profile
# Run development build
alias run-dev := run-profile
# Run release build
run-release: (run-profile "release" "")
# Run build with specified profile
[private]
run-profile profile="dev" args="":
cargo run --bin froglight --profile {{profile}} {{args}}
# Clean build artifacts
clean: (fetch-tools) (tools "clean")
cargo clean
# ---- Test Recipes ----
# Run all tests and all tool tests
all-tests: (update) (deny) (fmt) (test) (graph) (tools "all-tests")
# Run all tests and doc-tests
test: (nextest) (doc-test)
# Run all tests
nextest: (fetch-nextest)
cargo nextest run --workspace
# Get number of threads
threads := `nproc --all`
# Run all doc-tests
# Uses at most 4 threads
doc-test:
cargo test --doc --workspace -- --test-threads=$(( {{threads}} > 4 ? 4 : {{threads}} ))
# ---- Tool Recipes ----
# Run cargo deny
deny: (tools "deny")
cargo deny check
# Run cargo update
update:
cargo update
# Run clippy
clippy:
cargo clippy --workspace
# Run cargo fmt
fmt:
cargo fmt --all
# Run `just` in `tools/`
tools arg0="" arg1="" arg2="" arg3="" arg4="" arg5="" arg6="" arg7="": (fetch-tools)
@just --justfile tools/.justfile {{arg0}} {{arg1}} {{arg2}} {{arg3}} {{arg4}} {{arg5}} {{arg6}} {{arg7}}
# Generate froglight-internal graphs
graph:
RUST_LOG=info cargo run --package=froglight-internal --example=system-graph
# ---- Fetch Recipes ----
# Fetch `froglight-tools` submodule if not present
[private]
fetch-tools:
@if [ ! -f tools/.justfile ]; then git submodule update; fi
# Fetch `nextest` if not present
[private]
fetch-nextest:
@-cargo nextest --version > /dev/null 2>&1
@if [ $? -ne 0 ]; then cargo install nextest; fi