-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
justfile
85 lines (68 loc) · 2.19 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Set command aliases
alias a := audit
alias b := build
alias c := clean
alias f := format
alias i := install-binary
alias l := lint
alias r := run
alias t := test
alias cl := update-changelog
alias id := install-doc-requirements
alias sd := serve-docs
alias fmt := format
alias install-dev-deps := install-dev-dependencies
# Remove directory command
remove_dir := if os_family() == "windows" { "rmdir /S /Q" } else { "rm -rf" }
# Support for windows
# /D: Don't execute auto run commands from registry
# /C: Execute command and terminate
set windows-shell := ["cmd.exe", "/D", "/C"]
# Rust backtrace
export RUST_BACKTRACE := "1"
# for line 27: See rustsec/rustsec#696
# Audit the whole project (check for vulnerable dependencies)
audit *ARGUMENTS:
@cargo audit --ignore RUSTSEC-2020-0138 {{ARGUMENTS}}
# Compiles the rust source files
build *ARGUMENTS:
@cargo build --release --features cli {{ARGUMENTS}}
# Removes temporary files
@clean:
cargo clean
-{{remove_dir}} {{join("Tools", "__pycache__")}}
git gc
# Format all source files
format *ARGUMENTS:
@cargo +nightly fmt --all {{ARGUMENTS}}
# Install the `icomp` binary
install-binary:
@cargo install --path .
# Installs the executable development dependencies (this is gonna take a while)
install-dev-dependencies:
@cargo install git-cliff
@cargo install cargo-audit
# Install documentation dependencies
install-doc-requirements:
@pip install -r docs\.requirements.txt
# See rust-lang/cargo/12918 for why `-A clippy::std-instead-of-core` is needed
# Lints the rust source files
lint *ARGUMENTS:
@cargo clippy --all-targets --all-features --workspace -- -A clippy::std-instead-of-core {{ARGUMENTS}}
# Compiles and executes the main.rs file
run *ARGUMENTS:
@cargo run --features cli {{ARGUMENTS}}
# Serve documentation locally
serve-docs *ARGUMENTS:
@mkdocs serve -f docs\.mkdocs.yml {{ARGUMENTS}}
# Runs the tests
test *ARGUMENTS:
@cargo test --workspace {{ARGUMENTS}}
# Updated the changelog using git-cliff
update-changelog *ARGUMENTS:
@git cliff -c .github\cliff.toml -o docs\docs\CHANGELOG.md {{ARGUMENTS}}
@echo Updated changelog.
# Update all submodules
update-submodules:
@git submodule update --init --recursive --remote
@echo Updated submodules.