Skip to content

Commit

Permalink
build: fix doc-watch recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Jun 30, 2024
1 parent 4db4251 commit 0b193c7
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ _list:

# Format workspace.
fmt:
just --unstable --fmt
cargo +nightly fmt
fd --hidden --type=file --extension=md --extension=yml --exec-batch npx -y prettier --write

Expand All @@ -17,20 +18,14 @@ msrv := ```
| sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/'
```
msrv_rustup := "+" + msrv

non_linux_all_features_list := ```
cargo metadata --format-version=1 \
| jq '.packages[] | select(.source == null) | .features | keys' \
| jq -r --slurp \
--arg exclusions "__tls,__compress,tokio-uring,io-uring,experimental-io-uring" \
'add | unique | . - ($exclusions | split(",")) | join(",")'
```

all_crate_features := if os() == "linux" {
"--all-features"
} else {
"--features='" + non_linux_all_features_list + "'"
}
all_crate_features := if os() == "linux" { "--all-features" } else { "--features='" + non_linux_all_features_list + "'" }

[private]
check-min:
Expand Down Expand Up @@ -84,7 +79,8 @@ doc-set-workspace-crates:
#!/usr/bin/env bash
(
echo "window.ALL_CRATES ="
cargo metadata --format-version=1 | jq '[.packages[] | select(.source == null) | .name]'
cargo metadata --format-version=1 \
| jq '[.packages[] | select(.source == null) | .targets | map(select(.doc) | .name)] | flatten'
echo ";"
) > "$(cargo metadata --format-version=1 | jq -r '.target_directory')/doc/crates.js"
Expand All @@ -101,11 +97,7 @@ update-readmes: && fmt
cd ./actix-multipart && cargo rdme --force
cd ./actix-test && cargo rdme --force

feature_combo_skip_list := if os() == "linux" {
"__tls,__compress"
} else {
"__tls,__compress,experimental-io-uring"
}
feature_combo_skip_list := if os() == "linux" { "__tls,__compress" } else { "__tls,__compress,experimental-io-uring" }

# Checks compatibility of feature combinations.
check-feature-combinations:
Expand All @@ -120,7 +112,7 @@ check-external-types-all toolchain="+nightly":
set -euo pipefail
exit=0
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do
if ! just check-external-types-manifest "$f" {{toolchain}}; then exit=1; fi
if ! just check-external-types-manifest "$f" {{ toolchain }}; then exit=1; fi
echo
echo
done
Expand All @@ -133,9 +125,9 @@ check-external-types-all-table toolchain="+nightly":
for f in $(find . -mindepth 2 -maxdepth 2 -name Cargo.toml | grep -vE "\-codegen/|\-derive/|\-macros/"); do
echo
echo "Checking for $f"
just check-external-types-manifest "$f" {{toolchain}} --output-format=markdown-table
just check-external-types-manifest "$f" {{ toolchain }} --output-format=markdown-table
done
# Check for unintentional external type exposure on a crate.
check-external-types-manifest manifest_path toolchain="+nightly" *extra_args="":
cargo {{toolchain}} check-external-types --manifest-path "{{manifest_path}}" {{extra_args}}
cargo {{ toolchain }} check-external-types --manifest-path "{{ manifest_path }}" {{ extra_args }}

0 comments on commit 0b193c7

Please sign in to comment.