Justfile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. all: build test
  2. all-release: build-release test-release
  3. #----------#
  4. # building #
  5. #----------#
  6. # compile the exa binary
  7. @build:
  8. cargo build
  9. # compile the exa binary (in release mode)
  10. @build-release:
  11. cargo build --release --verbose
  12. # produce an HTML chart of compilation timings
  13. @build-time:
  14. cargo +nightly clean
  15. cargo +nightly build -Z timings
  16. # check that the exa binary can compile
  17. @check:
  18. cargo check
  19. #---------------#
  20. # running tests #
  21. #---------------#
  22. # run unit tests
  23. @test:
  24. cargo test --workspace -- --quiet
  25. # run unit tests (in release mode)
  26. @test-release:
  27. cargo test --workspace --release --verbose
  28. #------------------------#
  29. # running extended tests #
  30. #------------------------#
  31. # run extended tests
  32. @xtests:
  33. xtests/run.sh
  34. # run extended tests (using the release mode exa)
  35. @xtests-release:
  36. xtests/run.sh --release
  37. # display the number of extended tests that get run
  38. @count-xtests:
  39. grep -F '[[cmd]]' -R xtests | wc -l
  40. #-----------------------#
  41. # code quality and misc #
  42. #-----------------------#
  43. # lint the code
  44. @clippy:
  45. touch src/main.rs
  46. cargo clippy
  47. # update dependency versions, and checks for outdated ones
  48. @update-deps:
  49. cargo update
  50. command -v cargo-outdated >/dev/null || (echo "cargo-outdated not installed" && exit 1)
  51. cargo outdated
  52. # list unused dependencies
  53. @unused-deps:
  54. command -v cargo-udeps >/dev/null || (echo "cargo-udeps not installed" && exit 1)
  55. cargo +nightly udeps
  56. # check that every combination of feature flags is successful
  57. @check-features:
  58. command -v cargo-hack >/dev/null || (echo "cargo-hack not installed" && exit 1)
  59. cargo hack check --feature-powerset
  60. # build exa and run extended tests with features disabled
  61. @feature-checks *args:
  62. cargo build --no-default-features
  63. specsheet xtests/features/none.toml -shide {{args}} \
  64. -O cmd.target.exa="${CARGO_TARGET_DIR:-../../target}/debug/exa"
  65. # print versions of the necessary build tools
  66. @versions:
  67. rustc --version
  68. cargo --version
  69. #---------------#
  70. # documentation #
  71. #---------------#
  72. # build the man pages
  73. @man:
  74. mkdir -p "${CARGO_TARGET_DIR:-target}/man"
  75. pandoc --standalone -f markdown -t man man/eza.1.md > "${CARGO_TARGET_DIR:-target}/man/eza.1"
  76. pandoc --standalone -f markdown -t man man/eza_colors.5.md > "${CARGO_TARGET_DIR:-target}/man/eza_colors.5"
  77. # build and preview the main man page (eza.1)
  78. @man-1-preview: man
  79. man "${CARGO_TARGET_DIR:-target}/man/eza.1"
  80. # build and preview the colour configuration man page (eza_colors.5)
  81. @man-5-preview: man
  82. man "${CARGO_TARGET_DIR:-target}/man/eza_colors.5"