-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathjustfile
More file actions
62 lines (52 loc) · 1.63 KB
/
Copy pathjustfile
File metadata and controls
62 lines (52 loc) · 1.63 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
53
54
55
56
57
58
59
60
61
62
set dotenv-load
# Run unit tests
test-unit:
cargo test -p eric-sdk --lib --features no-linking
# Run integration tests (requires ERiC library)
test-integration:
cargo test -p eric-sdk --test '*' -- --test-threads=1
# Run cargo check with env vars
check:
cargo check
# Run cargo clippy with env vars
clippy:
cargo clippy --all-targets --all-features
# Run cargo build with env vars
build:
cargo build
# Run cargo build with env vars in release mode
build-release:
cargo build --release
# Run cargo semver-checks with env vars
semver:
cargo semver-checks
# Run cargo msrv with env vars
msrv:
cargo msrv find
# Generate bindings via bindgen
generate-bindings:
cargo build -p eric-bindings --features generate-bindings
# Generate bindings via bindgen and save into eric-bindings/bindings (maintainer-only)
save-bindings:
#!/usr/bin/env bash
set -euo pipefail
out_dir=$(cargo build -p eric-bindings --features generate-bindings --message-format=json \
| grep -o '"out_dir":"[^"]*eric-bindings-[^"]*"' \
| tail -1 \
| sed 's/"out_dir":"//;s/"$//')
if [ -z "$out_dir" ]; then
echo "Could not determine OUT_DIR for eric-bindings build script" >&2
exit 1
fi
src="$out_dir/bindings.rs"
host=$(rustc -vV | sed -n 's/^host: //p')
arch=$(echo "$host" | cut -d- -f1)
case "$host" in
*linux*) os=linux ;;
*darwin*|*apple*) os=darwin ;;
*) os=$(echo "$host" | cut -d- -f2) ;;
esac
version=$(echo "$ERIC_VERSION" | tr '.' '_')
dest="eric-bindings/bindings/bindings_eric_${version}_${os}_${arch}.rs"
cp "$src" "$dest"
echo "Wrote $dest"