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
|
|
|
|
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"
|
2023-07-29 12:19:05 +00:00
|
|
|
pandoc --standalone -f markdown -t man man/eza.1.md > "${CARGO_TARGET_DIR:-target}/man/eza.1"
|
|
|
|
pandoc --standalone -f markdown -t man man/eza_colors.5.md > "${CARGO_TARGET_DIR:-target}/man/eza_colors.5"
|
2023-08-04 04:04:28 +00:00
|
|
|
pandoc --standalone -f markdown -t man man/eza_colors-explanation.5.md > "${CARGO_TARGET_DIR:-target}/man/eza_colors-explanation.5"
|
2020-10-13 19:19:00 +00:00
|
|
|
|
2023-07-29 12:19:05 +00:00
|
|
|
# build and preview the main man page (eza.1)
|
2020-10-13 19:19:00 +00:00
|
|
|
@man-1-preview: man
|
2023-07-29 12:19:05 +00:00
|
|
|
man "${CARGO_TARGET_DIR:-target}/man/eza.1"
|
2020-10-13 19:19:00 +00:00
|
|
|
|
2023-07-29 12:19:05 +00:00
|
|
|
# build and preview the colour configuration man page (eza_colors.5)
|
2020-10-13 19:19:00 +00:00
|
|
|
@man-5-preview: man
|
2023-07-29 12:19:05 +00:00
|
|
|
man "${CARGO_TARGET_DIR:-target}/man/eza_colors.5"
|
2023-08-04 04:04:28 +00:00
|
|
|
|
|
|
|
# build and preview the colour configuration man page (eza_colors.5)
|
|
|
|
@man-5-explanations-preview: man
|
|
|
|
man "${CARGO_TARGET_DIR:-target}/man/eza_colors-explanation.5"
|
2023-08-22 08:56:09 +00:00
|
|
|
|
|
|
|
#---------------#
|
|
|
|
# release #
|
|
|
|
#---------------#
|
|
|
|
|
|
|
|
# If you're not cafkafk and she isn't dead, don't run this!
|
|
|
|
#
|
|
|
|
# usage: release major, release minor, release patch
|
|
|
|
@release version:
|
|
|
|
cargo bump '{{version}}'
|
|
|
|
git cliff -t $(grep '^version' Cargo.toml | head -n 1 | grep -E '([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?' -o) > CHANGELOG.md
|
|
|
|
cargo check
|
|
|
|
nix build -L ./#clippy
|
|
|
|
git checkout -b cafk-release-$(grep '^version' Cargo.toml | head -n 1 | grep -E '([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?' -o)
|
|
|
|
git commit -asm "chore: release $(grep '^version' Cargo.toml | head -n 1 | grep -E '([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?' -o)"
|
|
|
|
git push
|
|
|
|
echo "waiting 10 seconds for github to catch up..."
|
|
|
|
sleep 10
|
|
|
|
gh pr create --draft --title "chore: release $(grep '^version' Cargo.toml | head -n 1 | grep -E '([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?' -o)" --body "This PR was auto-generated by our lovely just file" --reviewer cafkafk
|
2023-09-07 07:44:30 +00:00
|
|
|
|
|
|
|
# If you're not cafkafk and she isn't dead, you probably don't need to run
|
|
|
|
# this!
|
|
|
|
#
|
|
|
|
# usage: cross
|
|
|
|
@cross:
|
2023-09-15 07:13:02 +00:00
|
|
|
# Install Toolchains/Targets
|
2023-09-07 07:44:30 +00:00
|
|
|
rustup toolchain install stable
|
2023-09-15 07:13:02 +00:00
|
|
|
|
|
|
|
## Linux
|
|
|
|
### x86
|
|
|
|
rustup target add x86_64-unknown-linux-gnu
|
|
|
|
rustup target add x86_64-unknown-linux-musl
|
|
|
|
|
|
|
|
### aarch
|
|
|
|
rustup target add aarch64-unknown-linux-gnu
|
|
|
|
|
|
|
|
### arm
|
|
|
|
rustup target add arm-unknown-linux-gnueabihf
|
|
|
|
|
|
|
|
## Windows
|
|
|
|
### x86
|
|
|
|
rustup target add x86_64-pc-windows-gnu
|
|
|
|
rustup target add x86_64-pc-windows-msvc
|
|
|
|
|
|
|
|
# Setup Output Directory
|
2023-09-11 09:48:55 +00:00
|
|
|
mkdir -p ./target/"bin-$(convco version)"
|
|
|
|
|
|
|
|
# Build
|
|
|
|
## Linux
|
2023-09-15 07:13:02 +00:00
|
|
|
### x86
|
2023-09-07 08:08:23 +00:00
|
|
|
cross build --target x86_64-unknown-linux-gnu --release
|
2023-09-11 09:48:55 +00:00
|
|
|
tar czvf ./target/"bin-$(convco version)"/eza_x86_64-unknown-linux-gnu.tar.gz -C ./target/x86_64-unknown-linux-gnu/release/ ./eza
|
2023-09-15 07:13:02 +00:00
|
|
|
|
2023-09-15 06:44:13 +00:00
|
|
|
cross build --release --target=x86_64-unknown-linux-musl
|
|
|
|
tar czvf ./target/"bin-$(convco version)"/eza_x86_64-unknown-linux-musl.tar.gz -C ./target/x86_64-unknown-linux-musl/release/ ./eza
|
2023-09-15 07:13:02 +00:00
|
|
|
|
2023-09-07 08:08:23 +00:00
|
|
|
cross build --target aarch64-unknown-linux-gnu --release
|
2023-09-11 09:48:55 +00:00
|
|
|
tar czvf ./target/"bin-$(convco version)"/eza_aarch64-unknown-linux-gnu.tar.gz -C ./target/aarch64-unknown-linux-gnu/release/ ./eza
|
2023-09-15 07:13:02 +00:00
|
|
|
|
2023-09-11 03:57:03 +00:00
|
|
|
cross build --target arm-unknown-linux-gnueabihf --release
|
2023-09-11 09:48:55 +00:00
|
|
|
tar czvf ./target/"bin-$(convco version)"/arm-unknown-linux-gnueabihf.tar.gz -C ./target/arm-unknown-linux-gnueabihf/release/ ./eza
|
2023-09-15 07:13:02 +00:00
|
|
|
|
2023-09-11 09:48:55 +00:00
|
|
|
## Windows
|
2023-09-07 08:08:23 +00:00
|
|
|
cross build --target x86_64-pc-windows-gnu --release
|
2023-09-11 09:48:55 +00:00
|
|
|
zip -j ./target/"bin-$(convco version)"/x86_64-pc-windows-gnu.zip ./target/x86_64-pc-windows-gnu/release/eza.exe
|
2023-09-15 07:13:02 +00:00
|
|
|
cross build --target x86_64-pc-windows-msvc --release
|
|
|
|
zip -j ./target/"bin-$(convco version)"/x86_64-pc-windows-msvc.zip ./target/x86_64-pc-windows-gnu/release/eza.exe
|
2023-09-11 09:48:55 +00:00
|
|
|
|
|
|
|
# Generate Checksums
|
|
|
|
echo "# Checksums"
|
|
|
|
echo "## sha256sum"
|
2023-09-15 06:55:07 +00:00
|
|
|
echo '```'
|
2023-09-11 09:48:55 +00:00
|
|
|
sha256sum ./target/"bin-$(convco version)"/*
|
2023-09-15 06:55:07 +00:00
|
|
|
echo '```'
|
2023-09-11 09:48:55 +00:00
|
|
|
echo "## md5sum"
|
2023-09-15 06:55:07 +00:00
|
|
|
echo '```'
|
2023-09-11 09:48:55 +00:00
|
|
|
md5sum ./target/"bin-$(convco version)"/*
|
2023-09-15 06:55:07 +00:00
|
|
|
echo '```'
|
2023-09-12 12:51:56 +00:00
|
|
|
|
|
|
|
#---------------------#
|
|
|
|
# Integration testing #
|
|
|
|
#---------------------#
|
|
|
|
|
|
|
|
# Runs integration tests in nix sandbox
|
|
|
|
#
|
|
|
|
# Required nix, likely won't work on windows.
|
|
|
|
@itest:
|
|
|
|
nix build -L ./#trycmd
|
|
|
|
|
|
|
|
# Runs integration tests in nix sandbox, and dumps outputs.
|
|
|
|
#
|
|
|
|
# WARNING: this can cause loss of work
|
|
|
|
@idump:
|
|
|
|
rm ./tests/cmd/*nix.stderr -f || echo
|
|
|
|
rm ./tests/cmd/*nix.stdout -f || echo
|
|
|
|
nix build -L ./#trydump
|
|
|
|
cp ./result/dump/*nix.* ./tests/cmd/
|
|
|
|
|