mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-09 03:57:24 +00:00
Simplify cargo-doc
We no longer need to selectively disable features or set the CARGO_DOC env var to successfully build crosvm. BUG=None TEST=None Change-Id: Ib997533c79340e3330a80633c4e8a81cbfb22ab6 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988653 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
parent
45b5c13047
commit
10a9c3304b
1 changed files with 7 additions and 39 deletions
|
@ -8,42 +8,10 @@ set -ex
|
||||||
# Build cargo-doc
|
# Build cargo-doc
|
||||||
# $ ./tools/cargo-doc --target-dir /path/to/dir
|
# $ ./tools/cargo-doc --target-dir /path/to/dir
|
||||||
|
|
||||||
echo "start cargo-doc"
|
cargo doc \
|
||||||
|
--workspace \
|
||||||
MANIFEST_PATH=$(dirname "$0")/../Cargo.toml
|
--no-deps \
|
||||||
|
--exclude crosvm-fuzz \
|
||||||
echo "manifest = ${MANIFEST_PATH}"
|
--features="all-x86_64" \
|
||||||
|
--document-private-items \
|
||||||
DISABLED_FEATURES=(
|
"$@"
|
||||||
audio_cras
|
|
||||||
chromeos
|
|
||||||
crash-report
|
|
||||||
libvda
|
|
||||||
video-decoder
|
|
||||||
video-encoder
|
|
||||||
)
|
|
||||||
|
|
||||||
ALL_FEATURES=$(
|
|
||||||
cargo metadata --manifest-path "${MANIFEST_PATH}" | \
|
|
||||||
jq -r '.packages[] |
|
|
||||||
select(.name == "crosvm") |
|
|
||||||
.features |
|
|
||||||
keys[]')
|
|
||||||
|
|
||||||
features=""
|
|
||||||
|
|
||||||
for f in $ALL_FEATURES; do
|
|
||||||
if [[ ! "${DISABLED_FEATURES[*]}" =~ $f ]]; then
|
|
||||||
features+=",${f}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Set an environment variable 'CARGO_DOC' here so that each build.rs can skip
|
|
||||||
# building unnecessary dependencies to generate documentations.
|
|
||||||
CARGO_DOC="true" cargo doc \
|
|
||||||
--manifest-path="${MANIFEST_PATH}" \
|
|
||||||
--workspace \
|
|
||||||
--no-deps \
|
|
||||||
--exclude crosvm-fuzz \
|
|
||||||
--features="${features}" "$@" \
|
|
||||||
--document-private-items
|
|
||||||
|
|
Loading…
Reference in a new issue