mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-11 04:26:38 +00:00
901cd7df7f
This is a reland of commit 2b85d4d1e5
Diff from the original CL:
* Changed the return value of `main()` in power_monitor/build.rs
* Ran cargo-check with all features enabled
Original change's description:
> github: Minimize dependencies for document generation
>
> Instead of install full dependencies with `install-deps` in GitHub
> action, minimize dependencies because we use GitHub only for document
> generation.
>
> - Passed `CARGO_DOC` environment when running cargo-doc command so we
> can skip unnecessary build flow when we just want to generate API docs.
> - Added a new script `install-docs-deps` to install only doc-related
> dependencies.
>
> BUG=none
> TEST=test on GitHub Action at my personal repository
>
> Change-Id: Ibe988ab43215e285d946812bdd6c1536ae87b50e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3578144
> Tested-by: kokoro <noreply+kokoro@google.com>
> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
> Reviewed-by: Anton Romanov <romanton@google.com>
> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Bug=none
TEST=cargo check --all-features
Change-Id: I77ee6543910e3fe7f69be48f8f965eda3433d4e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3584063
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
45 lines
1 KiB
Bash
Executable file
45 lines
1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Copyright 2021 The Chromium OS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
set -ex
|
|
|
|
# Build cargo-doc
|
|
# $ ./tools/cargo-doc --target-dir /path/to/dir
|
|
|
|
echo "start cargo-doc"
|
|
|
|
MANIFEST_PATH=$(dirname "$0")/../Cargo.toml
|
|
|
|
echo "manifest = ${MANIFEST_PATH}"
|
|
|
|
DISABLED_FEATURES=(
|
|
audio_cras
|
|
chromeos
|
|
libvda
|
|
power-monitor-powerd
|
|
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}" \
|
|
--features="${features}" "$@"
|