-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
justfile
60 lines (47 loc) · 1.37 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
target_dir := "target"
#----------
# Building
#----------
build: check-formatting test test-all build-simulator check-readme generate-docs
# Build the simulator
build-simulator:
cargo build --release --no-default-features
# Run cargo test in release mode
test:
cargo test --release
# Run cargo test in release mode with all features enabled
test-all:
cargo test --release --all-features
# Check the formatting
check-formatting:
cargo fmt --all -- --check
#------
# Docs
#------
# Generates the docs
generate-docs:
cargo clean --doc
cargo doc --all-features
# Runs cargo-deadlinks on the docs
check-links: generate-docs
cargo deadlinks
#----------------------
# README.md generation
# ---------------------
# Generate README.md for a single crate
generate-readme: (_build-readme)
cp {{target_dir}}/README.md README.md
# Check README.md for a single crate
@check-readme: (_build-readme)
diff -q {{target_dir}}/README.md README.md || ( \
echo -e "\033[1;31mError:\033[0m README.md needs to be regenerated."; \
echo -e " Run 'just generate-readme' to regenerate.\n"; \
exit 1 \
)
# Builds README.md for a single crate
_build-readme:
#!/usr/bin/env bash
set -e -o pipefail
mkdir -p {{target_dir}}/readme
echo "Building README.md"
cargo readme | sed -E -f filter_readme.sed > {{target_dir}}/README.md