2021-04-01 08:39:03 +00:00
|
|
|
all: build test
|
|
|
|
all-release: build-release test-release
|
Replace Makefile with a developmental Justfile
This commit deletes the Makefile, which contained targets to build exa and install it on the local machine, and replaces it with a Justfile, which only contains command to build and test exa.
My reasoning for doing this is as follows:
• exa is increasingly being installed through package managers, rather than built and tested locally, so users are avoiding using the Makefile at all.
• It was a pain to keep up with the correct paths for installing the binary, man pages, and completions, which can vary between OSes. By removing them, the code in this repository need only concern itself with building exa and putting its files in the 'target' directory, simplifying things.
• just is much simpler than make conceptually, which is why I prefer it. It just runs commands, rather than being a complete build system, which we already use Cargo for.
• just has features built-in, such as listing tasks, that we've had to create make targets for.
• exa only needed a Makefile at all because it pre-dates Cargo!
• Other Rust projects seem to be getting along perfectly fine without one.
If I've missed some important reason that makes it worth keeping the Makefile around then please let me know.
2020-10-09 23:47:17 +00:00
|
|
|
|
|
|
|
|
2021-04-01 08:39:03 +00:00
|
|
|
#----------#
|
|
|
|
# building #
|
|
|
|
#----------#
|
|
|
|
|
|
|
|
# compile the exa binary
|
Replace Makefile with a developmental Justfile
This commit deletes the Makefile, which contained targets to build exa and install it on the local machine, and replaces it with a Justfile, which only contains command to build and test exa.
My reasoning for doing this is as follows:
• exa is increasingly being installed through package managers, rather than built and tested locally, so users are avoiding using the Makefile at all.
• It was a pain to keep up with the correct paths for installing the binary, man pages, and completions, which can vary between OSes. By removing them, the code in this repository need only concern itself with building exa and putting its files in the 'target' directory, simplifying things.
• just is much simpler than make conceptually, which is why I prefer it. It just runs commands, rather than being a complete build system, which we already use Cargo for.
• just has features built-in, such as listing tasks, that we've had to create make targets for.
• exa only needed a Makefile at all because it pre-dates Cargo!
• Other Rust projects seem to be getting along perfectly fine without one.
If I've missed some important reason that makes it worth keeping the Makefile around then please let me know.
2020-10-09 23:47:17 +00:00
|
|
|
@build:
|
|
|
|
cargo build
|
|
|
|
|
2021-04-01 08:39:03 +00:00
|
|
|
# compile the exa binary (in release mode)
|
Replace Makefile with a developmental Justfile
This commit deletes the Makefile, which contained targets to build exa and install it on the local machine, and replaces it with a Justfile, which only contains command to build and test exa.
My reasoning for doing this is as follows:
• exa is increasingly being installed through package managers, rather than built and tested locally, so users are avoiding using the Makefile at all.
• It was a pain to keep up with the correct paths for installing the binary, man pages, and completions, which can vary between OSes. By removing them, the code in this repository need only concern itself with building exa and putting its files in the 'target' directory, simplifying things.
• just is much simpler than make conceptually, which is why I prefer it. It just runs commands, rather than being a complete build system, which we already use Cargo for.
• just has features built-in, such as listing tasks, that we've had to create make targets for.
• exa only needed a Makefile at all because it pre-dates Cargo!
• Other Rust projects seem to be getting along perfectly fine without one.
If I've missed some important reason that makes it worth keeping the Makefile around then please let me know.
2020-10-09 23:47:17 +00:00
|
|
|
@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
|
2020-10-09 23:57:20 +00:00
|
|
|
|
Replace Makefile with a developmental Justfile
This commit deletes the Makefile, which contained targets to build exa and install it on the local machine, and replaces it with a Justfile, which only contains command to build and test exa.
My reasoning for doing this is as follows:
• exa is increasingly being installed through package managers, rather than built and tested locally, so users are avoiding using the Makefile at all.
• It was a pain to keep up with the correct paths for installing the binary, man pages, and completions, which can vary between OSes. By removing them, the code in this repository need only concern itself with building exa and putting its files in the 'target' directory, simplifying things.
• just is much simpler than make conceptually, which is why I prefer it. It just runs commands, rather than being a complete build system, which we already use Cargo for.
• just has features built-in, such as listing tasks, that we've had to create make targets for.
• exa only needed a Makefile at all because it pre-dates Cargo!
• Other Rust projects seem to be getting along perfectly fine without one.
If I've missed some important reason that makes it worth keeping the Makefile around then please let me know.
2020-10-09 23:47:17 +00:00
|
|
|
|
2021-04-01 08:39:03 +00:00
|
|
|
#---------------#
|
|
|
|
# running tests #
|
|
|
|
#---------------#
|
|
|
|
|
|
|
|
# run unit tests
|
Replace Makefile with a developmental Justfile
This commit deletes the Makefile, which contained targets to build exa and install it on the local machine, and replaces it with a Justfile, which only contains command to build and test exa.
My reasoning for doing this is as follows:
• exa is increasingly being installed through package managers, rather than built and tested locally, so users are avoiding using the Makefile at all.
• It was a pain to keep up with the correct paths for installing the binary, man pages, and completions, which can vary between OSes. By removing them, the code in this repository need only concern itself with building exa and putting its files in the 'target' directory, simplifying things.
• just is much simpler than make conceptually, which is why I prefer it. It just runs commands, rather than being a complete build system, which we already use Cargo for.
• just has features built-in, such as listing tasks, that we've had to create make targets for.
• exa only needed a Makefile at all because it pre-dates Cargo!
• Other Rust projects seem to be getting along perfectly fine without one.
If I've missed some important reason that makes it worth keeping the Makefile around then please let me know.
2020-10-09 23:47:17 +00:00
|
|
|
@test:
|
2021-04-01 08:39:03 +00:00
|
|
|
cargo test --workspace -- --quiet
|
Replace Makefile with a developmental Justfile
This commit deletes the Makefile, which contained targets to build exa and install it on the local machine, and replaces it with a Justfile, which only contains command to build and test exa.
My reasoning for doing this is as follows:
• exa is increasingly being installed through package managers, rather than built and tested locally, so users are avoiding using the Makefile at all.
• It was a pain to keep up with the correct paths for installing the binary, man pages, and completions, which can vary between OSes. By removing them, the code in this repository need only concern itself with building exa and putting its files in the 'target' directory, simplifying things.
• just is much simpler than make conceptually, which is why I prefer it. It just runs commands, rather than being a complete build system, which we already use Cargo for.
• just has features built-in, such as listing tasks, that we've had to create make targets for.
• exa only needed a Makefile at all because it pre-dates Cargo!
• Other Rust projects seem to be getting along perfectly fine without one.
If I've missed some important reason that makes it worth keeping the Makefile around then please let me know.
2020-10-09 23:47:17 +00:00
|
|
|
|
2021-04-01 08:39:03 +00:00
|
|
|
# run unit tests (in release mode)
|
Replace Makefile with a developmental Justfile
This commit deletes the Makefile, which contained targets to build exa and install it on the local machine, and replaces it with a Justfile, which only contains command to build and test exa.
My reasoning for doing this is as follows:
• exa is increasingly being installed through package managers, rather than built and tested locally, so users are avoiding using the Makefile at all.
• It was a pain to keep up with the correct paths for installing the binary, man pages, and completions, which can vary between OSes. By removing them, the code in this repository need only concern itself with building exa and putting its files in the 'target' directory, simplifying things.
• just is much simpler than make conceptually, which is why I prefer it. It just runs commands, rather than being a complete build system, which we already use Cargo for.
• just has features built-in, such as listing tasks, that we've had to create make targets for.
• exa only needed a Makefile at all because it pre-dates Cargo!
• Other Rust projects seem to be getting along perfectly fine without one.
If I've missed some important reason that makes it worth keeping the Makefile around then please let me know.
2020-10-09 23:47:17 +00:00
|
|
|
@test-release:
|
2021-04-01 08:39:03 +00:00
|
|
|
cargo test --workspace --release --verbose
|
Replace Makefile with a developmental Justfile
This commit deletes the Makefile, which contained targets to build exa and install it on the local machine, and replaces it with a Justfile, which only contains command to build and test exa.
My reasoning for doing this is as follows:
• exa is increasingly being installed through package managers, rather than built and tested locally, so users are avoiding using the Makefile at all.
• It was a pain to keep up with the correct paths for installing the binary, man pages, and completions, which can vary between OSes. By removing them, the code in this repository need only concern itself with building exa and putting its files in the 'target' directory, simplifying things.
• just is much simpler than make conceptually, which is why I prefer it. It just runs commands, rather than being a complete build system, which we already use Cargo for.
• just has features built-in, such as listing tasks, that we've had to create make targets for.
• exa only needed a Makefile at all because it pre-dates Cargo!
• Other Rust projects seem to be getting along perfectly fine without one.
If I've missed some important reason that makes it worth keeping the Makefile around then please let me know.
2020-10-09 23:47:17 +00:00
|
|
|
|
2020-10-09 23:57:20 +00:00
|
|
|
|
2021-04-01 08:39:03 +00:00
|
|
|
#------------------------#
|
|
|
|
# running extended tests #
|
|
|
|
#------------------------#
|
Replace Makefile with a developmental Justfile
This commit deletes the Makefile, which contained targets to build exa and install it on the local machine, and replaces it with a Justfile, which only contains command to build and test exa.
My reasoning for doing this is as follows:
• exa is increasingly being installed through package managers, rather than built and tested locally, so users are avoiding using the Makefile at all.
• It was a pain to keep up with the correct paths for installing the binary, man pages, and completions, which can vary between OSes. By removing them, the code in this repository need only concern itself with building exa and putting its files in the 'target' directory, simplifying things.
• just is much simpler than make conceptually, which is why I prefer it. It just runs commands, rather than being a complete build system, which we already use Cargo for.
• just has features built-in, such as listing tasks, that we've had to create make targets for.
• exa only needed a Makefile at all because it pre-dates Cargo!
• Other Rust projects seem to be getting along perfectly fine without one.
If I've missed some important reason that makes it worth keeping the Makefile around then please let me know.
2020-10-09 23:47:17 +00:00
|
|
|
|
2021-04-01 08:39:03 +00:00
|
|
|
# run extended tests
|
Use Specsheet for the extended tests
This commit changes the way the extended test suite is run.
Previously, there was a folder full of outputs, and a script that ran exa repeatedly to check the outputs match. This script was hacked-together, with many problems:
• It stops at the first failure, so if one test fails, you have no idea how many actually failed.
• It also didn't actually show you the diff if one was different, it just checked it.
• It combined stdout and stderr, and didn't test the exit status of exa.
• All the output file names were just whatever I felt like calling the file at the time.
• There is no way to only run a few of the tests — you have to run the whole thing each time.
• There's no feel-good overall view where you see how many tests are passing.
I started writing Specsheet to solve this problem (amongst other problems), and now, three and a half years later, it's finally ready for prime time.
The tests are now defined as data rather than as a script. The outputs have a consistent naming convention (directory_flags.ansitxt), and they check stdout, stderr, and exit status separately. Specsheet also lets simple outputs (empty, non-empty, or one-line error messages) can be written inline rather than needing to be in files.
So even though this pretty much runs the same tests as the run.sh script did, the tests are now more organised, making it easy to see where tests are missing and functionality is not being tested.
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)
|
Use Specsheet for the extended tests
This commit changes the way the extended test suite is run.
Previously, there was a folder full of outputs, and a script that ran exa repeatedly to check the outputs match. This script was hacked-together, with many problems:
• It stops at the first failure, so if one test fails, you have no idea how many actually failed.
• It also didn't actually show you the diff if one was different, it just checked it.
• It combined stdout and stderr, and didn't test the exit status of exa.
• All the output file names were just whatever I felt like calling the file at the time.
• There is no way to only run a few of the tests — you have to run the whole thing each time.
• There's no feel-good overall view where you see how many tests are passing.
I started writing Specsheet to solve this problem (amongst other problems), and now, three and a half years later, it's finally ready for prime time.
The tests are now defined as data rather than as a script. The outputs have a consistent naming convention (directory_flags.ansitxt), and they check stdout, stderr, and exit status separately. Specsheet also lets simple outputs (empty, non-empty, or one-line error messages) can be written inline rather than needing to be in files.
So even though this pretty much runs the same tests as the run.sh script did, the tests are now more organised, making it easy to see where tests are missing and functionality is not being tested.
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
|
|
|
|
|
Use Specsheet for the extended tests
This commit changes the way the extended test suite is run.
Previously, there was a folder full of outputs, and a script that ran exa repeatedly to check the outputs match. This script was hacked-together, with many problems:
• It stops at the first failure, so if one test fails, you have no idea how many actually failed.
• It also didn't actually show you the diff if one was different, it just checked it.
• It combined stdout and stderr, and didn't test the exit status of exa.
• All the output file names were just whatever I felt like calling the file at the time.
• There is no way to only run a few of the tests — you have to run the whole thing each time.
• There's no feel-good overall view where you see how many tests are passing.
I started writing Specsheet to solve this problem (amongst other problems), and now, three and a half years later, it's finally ready for prime time.
The tests are now defined as data rather than as a script. The outputs have a consistent naming convention (directory_flags.ansitxt), and they check stdout, stderr, and exit status separately. Specsheet also lets simple outputs (empty, non-empty, or one-line error messages) can be written inline rather than needing to be in files.
So even though this pretty much runs the same tests as the run.sh script did, the tests are now more organised, making it easy to see where tests are missing and functionality is not being tested.
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:
|
2020-10-10 01:14:35 +00:00
|
|
|
cargo update
|
2020-10-24 20:22:07 +00:00
|
|
|
command -v cargo-outdated >/dev/null || (echo "cargo-outdated not installed" && exit 1)
|
2020-10-10 01:14:35 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
# print versions of the necessary build tools
|
Replace Makefile with a developmental Justfile
This commit deletes the Makefile, which contained targets to build exa and install it on the local machine, and replaces it with a Justfile, which only contains command to build and test exa.
My reasoning for doing this is as follows:
• exa is increasingly being installed through package managers, rather than built and tested locally, so users are avoiding using the Makefile at all.
• It was a pain to keep up with the correct paths for installing the binary, man pages, and completions, which can vary between OSes. By removing them, the code in this repository need only concern itself with building exa and putting its files in the 'target' directory, simplifying things.
• just is much simpler than make conceptually, which is why I prefer it. It just runs commands, rather than being a complete build system, which we already use Cargo for.
• just has features built-in, such as listing tasks, that we've had to create make targets for.
• exa only needed a Makefile at all because it pre-dates Cargo!
• Other Rust projects seem to be getting along perfectly fine without one.
If I've missed some important reason that makes it worth keeping the Makefile around then please let me know.
2020-10-09 23:47:17 +00:00
|
|
|
@versions:
|
|
|
|
rustc --version
|
|
|
|
cargo --version
|
2020-10-13 19:19:00 +00:00
|
|
|
|
|
|
|
|
2021-04-01 08:39:03 +00:00
|
|
|
#---------------#
|
|
|
|
# documentation #
|
|
|
|
#---------------#
|
|
|
|
|
|
|
|
# build the man pages
|
2020-10-13 19:19:00 +00:00
|
|
|
@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)
|
2020-10-13 19:19:00 +00:00
|
|
|
@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)
|
2020-10-13 19:19:00 +00:00
|
|
|
@man-5-preview: man
|
|
|
|
man "${CARGO_TARGET_DIR:-target}/man/exa_colors.5"
|