2023-02-15 03:40:42 +00:00
|
|
|
#!/usr/bin/env just --justfile
|
|
|
|
|
2023-02-24 00:11:40 +00:00
|
|
|
alias b := build
|
|
|
|
alias br := build-release
|
2023-02-15 03:40:42 +00:00
|
|
|
alias r := run
|
2023-02-17 03:41:16 +00:00
|
|
|
alias h := show-help
|
2023-02-15 03:40:42 +00:00
|
|
|
alias t := test
|
|
|
|
alias l := lint
|
|
|
|
alias c := check
|
|
|
|
alias cov := coverage-report
|
|
|
|
|
|
|
|
default: lint test run
|
|
|
|
|
|
|
|
# Test the program with all features enabled.
|
|
|
|
test:
|
|
|
|
cargo test --all-features
|
|
|
|
|
|
|
|
# Check the program with all features enabled.
|
|
|
|
check:
|
|
|
|
cargo check --all-features
|
|
|
|
|
|
|
|
lint:
|
|
|
|
cargo clippy --all-features --all-targets -- -D warnings
|
|
|
|
|
2023-02-24 00:11:40 +00:00
|
|
|
# Build the program with all features enabled
|
|
|
|
build:
|
|
|
|
cargo build --all-features
|
|
|
|
|
|
|
|
# Build the program with all features enabled in release mode
|
|
|
|
build-release:
|
|
|
|
cargo build --all-features --release
|
|
|
|
|
2023-02-15 03:40:42 +00:00
|
|
|
# Run the program with all features enabled and the debug profile
|
2023-02-24 00:11:40 +00:00
|
|
|
run: build
|
2023-02-15 03:40:42 +00:00
|
|
|
RUST_BACKTRACE=1 RUST_LOG=debug cargo run --all-features
|
|
|
|
|
2023-02-17 03:41:16 +00:00
|
|
|
# Run the program with all features enabled and use the `--help` flag
|
|
|
|
show-help:
|
|
|
|
cargo run --all-features -- --help
|
|
|
|
|
2023-02-15 03:40:42 +00:00
|
|
|
# Run the tests, and genrate a coverage report
|
|
|
|
coverage:
|
|
|
|
CARGO_INCREMENTAL=0 RUSTFLAGS="-Cinstrument-coverage" LLVM_PROFILE_FILE="target/coverage/data/cargo-test-%p-%m.profraw" cargo test --all-features
|
|
|
|
|
|
|
|
# Generate the coverage report
|
|
|
|
coverage-report: coverage
|
2023-02-17 03:05:17 +00:00
|
|
|
# Generate the report in html format using grcov
|
2023-02-15 03:40:42 +00:00
|
|
|
grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore "../*" -o ./target/coverage/report/ --llvm --ignore "/*"
|
|
|
|
|
|
|
|
# Open the report in the browser
|
|
|
|
xdg-open ./target/coverage/report/index.html
|
2023-02-17 05:48:29 +00:00
|
|
|
|
|
|
|
remove-config:
|
2023-02-24 00:11:40 +00:00
|
|
|
rm -rf ~/.config/cmus-notify/
|
|
|
|
|
|
|
|
markdown-help: build
|
|
|
|
cargo run --all-features -- --markdown-help > docs/usage.md
|