-
Notifications
You must be signed in to change notification settings - Fork 14
/
justfile
56 lines (42 loc) · 1.67 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
TARGET := `rustc -vV | sed -n 's|host: ||p'`
export CMAKE_BUILD_PARALLEL_LEVEL := `nproc --all`
run *FLAGS:
cargo run --target {{ TARGET }} {{ FLAGS }}
build *FLAGS:
#!/usr/bin/env bash
set -ex
if [ "{{ TARGET }}" == "wasm32-unknown-emscripten" ]; then
FLAGS="--no-default-features";
elif [ "{{ TARGET }}" == "wasm32-unknown-unknown" ]; then
exit 0
fi
cargo build --bin dslcad --target {{ TARGET }} $FLAGS {{ FLAGS }}
build-viewer *FLAGS:
#!/usr/bin/env bash
set -ex
if [ "{{ TARGET }}" == "wasm32-unknown-emscripten" ]; then
exit 0
fi
cargo build --bin dslcad-viewer --target {{ TARGET }} --release {{ FLAGS }}
if [ "{{ TARGET }}" == "wasm32-unknown-unknown" ]; then
wasm-bindgen --out-dir ./target/wasm32-unknown-unknown/release --target web ./target/wasm32-unknown-unknown/release/dslcad-viewer.wasm
sed -i 's/wasm.__wbindgen_start();//' ./target/wasm32-unknown-unknown/release/dslcad-viewer.js
fi
build-docs-editor *FLAGS:
just TARGET=wasm32-unknown-emscripten build --release {{ FLAGS }}
just TARGET=wasm32-unknown-unknown build-viewer {{ FLAGS }}
mkdir -p docs/editor
cp target/wasm32-unknown-emscripten/release/dslcad* ./docs/editor/
cp target/wasm32-unknown-unknown/release/dslcad-viewer* ./docs/editor/
pack: (build "--release") build-viewer
-rm {{ TARGET }}.zip
rm target/{{ TARGET }}/release/*.d
zip -j {{ TARGET }}.zip target/{{ TARGET }}/release/*
check:
cargo +nightly fmt --check
cargo clippy --target {{ TARGET }} --all-targets -- -Dwarnings
cargo test --target {{ TARGET }}
install:
cargo install --path crates/dslcad
clean:
cargo clean