-
Notifications
You must be signed in to change notification settings - Fork 198
Expand file tree
/
Copy pathcargo.just
More file actions
52 lines (41 loc) · 1.23 KB
/
cargo.just
File metadata and controls
52 lines (41 loc) · 1.23 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
cargo-target-dir := env('CARGO_TARGET_DIR', 'target')
# Compile with debug profile
build-debug *args:
cargo build {{ args }}
# Compile with release profile
build-release *args: (build-debug '--release' args)
# Compile with a vendored tarball
build-vendored *args: vendor-extract (build-release '--frozen --offline' args)
# Check for errors and linter warnings
check *args:
cargo clippy --all-features {{ args }} -- -W clippy::pedantic
# Runs a check with JSON message format for IDE integration
check-json: (check '--message-format=json')
# Remove Cargo build artifacts
[no-cd]
clean:
cargo clean
# Also remove .cargo and vendored dependencies
[no-cd]
clean-dist: clean
rm -rf .cargo vendor vendor.tar target
# Run the application for testing purposes
run *args:
env RUST_LOG=debug RUST_BACKTRACE=full cargo run {{ args }} --release
# Run `cargo test`
test *args:
cargo test {{ args }}
# Vendor Cargo dependencies locally
[no-cd]
vendor:
mkdir -p .cargo
cargo vendor --locked | head -n -1 > .cargo/config.toml
echo 'directory = "vendor"' >> .cargo/config.toml
tar pcf vendor.tar vendor
rm -rf vendor
# Extracts vendored dependencies
[no-cd]
[private]
vendor-extract:
rm -rf vendor
tar pxf vendor.tar