forked from tlspuffin/tlspuffin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
47 lines (33 loc) · 1.52 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
#!/usr/bin/env just --justfile
# ^ A shebang isn't required, but allows a justfile to be executed
# like a script, with `./justfile test`, for example.
set shell := ["bash", "-c"]
export NIGHTLY_TOOLCHAIN := "nightly-2022-04-04-x86_64-unknown-linux-gnu"
export CARGO_TERM_COLOR := "always"
export RUST_BACKTRACE := "1"
nightly-toolchain:
rustup install $NIGHTLY_TOOLCHAIN
rustup component add rust-src --toolchain $NIGHTLY_TOOLCHAIN
install-clippy:
rustup component add clippy
check PROJECT ARCH FEATURES CARGO_FLAGS="": install-clippy
cargo clippy --no-deps -p {{PROJECT}} --target {{ARCH}} --features "{{FEATURES}}" {{CARGO_FLAGS}}
fix PROJECT ARCH FEATURES CARGO_FLAGS="": install-clippy
cargo clippy --no-deps -p {{PROJECT}} --target {{ARCH}} --features "{{FEATURES}}" {{CARGO_FLAGS}} --fix
test PROJECT ARCH FEATURES CARGO_FLAGS="":
cargo test -p {{PROJECT}} --target {{ARCH}} --features "{{FEATURES}}" {{CARGO_FLAGS}}
build PROJECT ARCH FEATURES CARGO_FLAGS="":
cargo build -p {{PROJECT}} --target {{ARCH}} --release --features "{{FEATURES}}" {{CARGO_FLAGS}}
benchmark:
cargo bench -p tlspuffin --features "openssl111"
install-rustfmt: nightly-toolchain
rustup component add rustfmt --toolchain $NIGHTLY_TOOLCHAIN
fmt: install-rustfmt
export RUSTUP_TOOLCHAIN=$NIGHTLY_TOOLCHAIN && cargo fmt
fmt-check: install-rustfmt
export RUSTUP_TOOLCHAIN=$NIGHTLY_TOOLCHAIN && cargo fmt -- --check
default-toolchain:
# Setups the toolchain from rust-toolchain.toml
cargo --version > /dev/null
book-serve:
mdbook serve docs