1
0

Justfile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. alias itest := integration_tests
  29. @integration_tests:
  30. VHS_PUBLISH=false ./tests/vhs-runner.sh
  31. #------------------------#
  32. # running extended tests #
  33. #------------------------#
  34. # run extended tests
  35. @xtests:
  36. xtests/run.sh
  37. # run extended tests (using the release mode exa)
  38. @xtests-release:
  39. xtests/run.sh --release
  40. # display the number of extended tests that get run
  41. @count-xtests:
  42. grep -F '[[cmd]]' -R xtests | wc -l
  43. #-----------------------#
  44. # code quality and misc #
  45. #-----------------------#
  46. # lint the code
  47. @clippy:
  48. touch src/main.rs
  49. cargo clippy
  50. # update dependency versions, and checks for outdated ones
  51. @update-deps:
  52. cargo update
  53. command -v cargo-outdated >/dev/null || (echo "cargo-outdated not installed" && exit 1)
  54. cargo outdated
  55. # list unused dependencies
  56. @unused-deps:
  57. command -v cargo-udeps >/dev/null || (echo "cargo-udeps not installed" && exit 1)
  58. cargo +nightly udeps
  59. # check that every combination of feature flags is successful
  60. @check-features:
  61. command -v cargo-hack >/dev/null || (echo "cargo-hack not installed" && exit 1)
  62. cargo hack check --feature-powerset
  63. # build exa and run extended tests with features disabled
  64. @feature-checks *args:
  65. cargo build --no-default-features
  66. specsheet xtests/features/none.toml -shide {{args}} \
  67. -O cmd.target.exa="${CARGO_TARGET_DIR:-../../target}/debug/exa"
  68. # print versions of the necessary build tools
  69. @versions:
  70. rustc --version
  71. cargo --version
  72. #---------------#
  73. # documentation #
  74. #---------------#
  75. # build the man pages
  76. @man:
  77. mkdir -p "${CARGO_TARGET_DIR:-target}/man"
  78. pandoc --standalone -f markdown -t man man/eza.1.md > "${CARGO_TARGET_DIR:-target}/man/eza.1"
  79. pandoc --standalone -f markdown -t man man/eza_colors.5.md > "${CARGO_TARGET_DIR:-target}/man/eza_colors.5"
  80. pandoc --standalone -f markdown -t man man/eza_colors-explanation.5.md > "${CARGO_TARGET_DIR:-target}/man/eza_colors-explanation.5"
  81. # build and preview the main man page (eza.1)
  82. @man-1-preview: man
  83. man "${CARGO_TARGET_DIR:-target}/man/eza.1"
  84. # build and preview the colour configuration man page (eza_colors.5)
  85. @man-5-preview: man
  86. man "${CARGO_TARGET_DIR:-target}/man/eza_colors.5"
  87. # build and preview the colour configuration man page (eza_colors.5)
  88. @man-5-explanations-preview: man
  89. man "${CARGO_TARGET_DIR:-target}/man/eza_colors-explanation.5"