exa/Justfile

111 lines
2.6 KiB
Makefile
Raw Permalink Normal View History

2021-04-01 08:39:03 +00:00
all: build test
all-release: build-release test-release
2021-04-01 08:39:03 +00:00
#----------#
# building #
#----------#
# compile the exa binary
@build:
cargo build
2021-04-01 08:39:03 +00:00
# compile the exa binary (in release mode)
@build-release:
cargo build --release --verbose
2021-04-01 08:39:03 +00:00
# produce an HTML chart of compilation timings
@build-time:
cargo +nightly clean
cargo +nightly build -Z timings
# check that the exa binary can compile
@check:
cargo check
2021-04-01 08:39:03 +00:00
#---------------#
# running tests #
#---------------#
# run unit tests
@test:
2021-04-01 08:39:03 +00:00
cargo test --workspace -- --quiet
2021-04-01 08:39:03 +00:00
# run unit tests (in release mode)
@test-release:
2021-04-01 08:39:03 +00:00
cargo test --workspace --release --verbose
2021-04-01 08:39:03 +00:00
#------------------------#
# running extended tests #
#------------------------#
2021-04-01 08:39:03 +00:00
# run extended tests
2020-10-17 19:39:44 +00:00
@xtests:
xtests/run.sh
2021-04-01 08:39:03 +00:00
# run extended tests (using the release mode exa)
2020-10-17 19:39:44 +00:00
@xtests-release:
xtests/run.sh --release
2021-04-01 08:39:03 +00:00
# display the number of extended tests that get run
@count-xtests:
grep -F '[[cmd]]' -R xtests | wc -l
2020-10-17 19:39:44 +00:00
2021-04-01 08:39:03 +00:00
#-----------------------#
# code quality and misc #
#-----------------------#
# lint the code
2020-10-10 12:33:50 +00:00
@clippy:
touch src/main.rs
cargo clippy
2021-04-01 08:39:03 +00:00
# update dependency versions, and checks for outdated ones
2020-10-24 20:22:07 +00:00
@update-deps:
cargo update
2020-10-24 20:22:07 +00:00
command -v cargo-outdated >/dev/null || (echo "cargo-outdated not installed" && exit 1)
cargo outdated
2021-04-01 08:39:03 +00:00
# list unused dependencies
2020-10-24 20:22:07 +00:00
@unused-deps:
command -v cargo-udeps >/dev/null || (echo "cargo-udeps not installed" && exit 1)
cargo +nightly udeps
2021-04-01 08:39:03 +00:00
# check that every combination of feature flags is successful
@check-features:
command -v cargo-hack >/dev/null || (echo "cargo-hack not installed" && exit 1)
cargo hack check --feature-powerset
# build exa and run extended tests with features disabled
@feature-checks *args:
cargo build --no-default-features
specsheet xtests/features/none.toml -shide {{args}} \
-O cmd.target.exa="${CARGO_TARGET_DIR:-../../target}/debug/exa"
2021-04-01 08:39:03 +00:00
# print versions of the necessary build tools
@versions:
rustc --version
cargo --version
2021-04-01 08:39:03 +00:00
#---------------#
# documentation #
#---------------#
# build the man pages
@man:
mkdir -p "${CARGO_TARGET_DIR:-target}/man"
pandoc --standalone -f markdown -t man man/exa.1.md > "${CARGO_TARGET_DIR:-target}/man/exa.1"
pandoc --standalone -f markdown -t man man/exa_colors.5.md > "${CARGO_TARGET_DIR:-target}/man/exa_colors.5"
2021-04-01 08:39:03 +00:00
# build and preview the main man page (exa.1)
@man-1-preview: man
man "${CARGO_TARGET_DIR:-target}/man/exa.1"
2021-04-01 08:39:03 +00:00
# build and preview the colour configuration man page (exa_colors.5)
@man-5-preview: man
man "${CARGO_TARGET_DIR:-target}/man/exa_colors.5"