Skip to content

Commit c2298f1

Browse files
committed
Add all-features and specific features to justfile
Change the justfile so that there are now two cases: - first are all the crates that can be build with --all-features, - second is the list of crates that cannot and are instead built only with the specified features. node and integration_test are build with the "latest" feature only.
1 parent 14a2a5a commit c2298f1

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

justfile

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ set export
22

33
REPO_DIR := `git rev-parse --show-toplevel`
44

5+
# Targets where `--all-features` is used.
6+
ALL_FEATURE_CRATES := "bitreq client fuzz jsonrpc types verify"
7+
8+
# Targets with conflicting features and only `SPECIFIC_FEATURES` are used.
9+
SPECIFIC_FEATURES_CRATES := "integration_test node"
10+
SPECIFIC_FEATURES := "latest"
11+
512
alias ulf := update-lock-files
613
alias l := lint
714
alias li := lint-integration-tests
@@ -12,15 +19,21 @@ default:
1219

1320
# Cargo build everything.
1421
build:
15-
cargo build --workspace --all-targets --all-features
22+
for crate in {{ALL_FEATURE_CRATES}}; do cargo build --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --all-features; done
23+
24+
for crate in {{SPECIFIC_FEATURES_CRATES}}; do cargo build --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --no-default-features --features={{SPECIFIC_FEATURES}}; done
1625

1726
# Cargo check everything.
1827
check:
19-
cargo check --workspace --all-targets --all-features
28+
for crate in {{ALL_FEATURE_CRATES}}; do cargo check --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --all-features; done
29+
30+
for crate in {{SPECIFIC_FEATURES_CRATES}}; do cargo check --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --no-default-features --features={{SPECIFIC_FEATURES}}; done
2031

2132
# Lint everything.
2233
lint: lint-verify lint-integration-tests
23-
cargo +$(cat ./nightly-version) clippy --workspace --all-targets --all-features -- --deny warnings
34+
for crate in {{ALL_FEATURE_CRATES}}; do cargo +$(cat ./nightly-version) clippy --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --all-features -- --deny warnings; done
35+
36+
for crate in {{SPECIFIC_FEATURES_CRATES}}; do cargo +$(cat ./nightly-version) clippy --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-targets --no-default-features --features={{SPECIFIC_FEATURES}} -- --deny warnings; done
2437

2538
lint-verify:
2639
$REPO_DIR/contrib/lint-verify.sh
@@ -40,7 +53,9 @@ format:
4053

4154
# Generate documentation.
4255
docsrs *flags:
43-
RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ./nightly-version) doc --all-features {{flags}}
56+
for crate in {{ALL_FEATURE_CRATES}}; do RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ./nightly-version) doc --manifest-path "$REPO_DIR/$crate/Cargo.toml" --all-features {{flags}}; done
57+
58+
for crate in {{SPECIFIC_FEATURES_CRATES}}; do RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +$(cat ./nightly-version) doc --manifest-path "$REPO_DIR/$crate/Cargo.toml" --no-default-features --features={{SPECIFIC_FEATURES}} {{flags}}; done
4459

4560
# Update the recent and minimal lock files.
4661
update-lock-files:

0 commit comments

Comments
 (0)