Skip to content

Commit

Permalink
chore(just): fix justfile by bringing in changes from AoC repo
Browse files Browse the repository at this point in the history
  • Loading branch information
clechasseur committed Dec 19, 2024
1 parent 1988062 commit b6e06be
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ message_format_flag := if message_format != "" { "--message-format " + message_f
target_tuple := ""
target_tuple_flag := if target_tuple != "" { "--target " + target_tuple } else { "" }

release := "false"
release_flag := if release == "true" { "--release" } else { "" }

# Note: there seems to be an issue in `cargo-tarpaulin` when using Rust 1.75.0 or later - it reports some missing line coverage.
# I've entered an issue: https://github.com/xd009642/tarpaulin/issues/1438
# In the meantime, let's pin the Rust version used for code coverage to 1.74.1 until we know what's happening.
Expand All @@ -26,6 +29,10 @@ cargo_tarpaulin := tool + (if toolchain != "" { " +" + toolchain } else { " +1.7
default:
@just --list

# Run main executable
run *extra_args:
{{cargo}} run {{all_features_flag}} {{target_tuple_flag}} {{release_flag}} {{ if extra_args != '' { '-- ' + extra_args } else { '' } }}

# Run clippy and rustfmt on workspace files
tidy: clippy fmt

Expand All @@ -39,15 +46,15 @@ fmt:

# Run `cargo check` on workspace
check *extra_args:
{{cargo}} check --workspace {{all_targets_flag}} {{all_features_flag}} {{message_format_flag}} {{target_tuple_flag}} {{extra_args}}
{{cargo}} check --workspace {{all_targets_flag}} {{all_features_flag}} {{message_format_flag}} {{target_tuple_flag}} {{release_flag}} {{extra_args}}

# Run `cargo build` on workspace
build *extra_args:
{{cargo}} build --workspace {{all_targets_flag}} {{all_features_flag}} {{message_format_flag}} {{target_tuple_flag}} {{extra_args}}
{{cargo}} build --workspace {{all_targets_flag}} {{all_features_flag}} {{message_format_flag}} {{target_tuple_flag}} {{release_flag}} {{extra_args}}

# Run `cargo test` on workspace
test *extra_args:
{{cargo}} test --workspace {{all_features_flag}} {{message_format_flag}} {{target_tuple_flag}} {{extra_args}}
{{cargo}} test --workspace {{all_features_flag}} {{message_format_flag}} {{target_tuple_flag}} {{release_flag}} {{extra_args}}

# Run `cargo update` to update dependencies in Cargo.lock
update *extra_args:
Expand Down Expand Up @@ -91,11 +98,11 @@ _check-minimal-only: (_rimraf "target-minimal")

# Run `cargo msrv` with `cargo minimal-versions check`
msrv-minimal: (prep "--manifest-backup-suffix .msrv-prep.outer.bak") && (_rimraf "target-minimal") (unprep "--manifest-backup-suffix .msrv-prep.outer.bak")
{{cargo}} msrv -- just all_features="{{all_features}}" message_format="{{message_format}}" target_tuple="{{target_tuple}}" _check-minimal-only
{{cargo}} msrv find -- just all_features="{{all_features}}" message_format="{{message_format}}" target_tuple="{{target_tuple}}" _check-minimal-only

# Run `cargo msrv` with `cargo check`
msrv *extra_args: && (_rimraf "target-msrv")
{{cargo}} msrv -- just all_features="{{all_features}}" all_targets="{{all_targets}}" message_format="{{message_format}}" target_tuple="{{target_tuple}}" _msrv-check {{extra_args}}
msrv *extra_args: (prep "--manifest-backup-suffix .msrv-prep.outer.bak --no-merge-pinned-dependencies") && (_rimraf "target-msrv") (unprep "--manifest-backup-suffix .msrv-prep.outer.bak")
{{cargo}} msrv find -- just all_features="{{all_features}}" all_targets="{{all_targets}}" message_format="{{message_format}}" target_tuple="{{target_tuple}}" _msrv-check {{extra_args}}

_msrv-check *extra_args: (_rimraf "target-msrv")
just all_features="{{all_features}}" all_targets="{{all_targets}}" message_format="{{message_format}}" target_tuple="{{target_tuple}}" check --target-dir target-msrv {{extra_args}}
Expand Down

0 comments on commit b6e06be

Please sign in to comment.