mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-10 20:19:07 +00:00
tools: Add cargo-doc script
BUG=none TEST=Run GitHub Action on my personal GitHub repository Change-Id: I62de2693f3a654e0bbd327eff5931380a153395d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3305958 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dennis Kempin <denniskempin@google.com> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
This commit is contained in:
parent
48ee10414c
commit
3e7c388efa
3 changed files with 43 additions and 4 deletions
4
.github/workflows/gh-pages.yml
vendored
4
.github/workflows/gh-pages.yml
vendored
|
@ -28,9 +28,7 @@ jobs:
|
|||
- name: Run cargo doc
|
||||
run: |
|
||||
git submodule update --init
|
||||
# TODO audio_cras, chromeos, power-monitor-powerd
|
||||
cargo doc --target-dir ./docs/target/ \
|
||||
--features "audio composite-disk default default-no-sandbox direct gdb gfxstream gpu plugin tpm usb video-decoder video-encoder virgl_renderer virgl_renderer_next wl-dmabuf x"
|
||||
./tools/cargo-doc --target-dir ./docs/target/
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
|
|
|
@ -8,4 +8,5 @@ source "$(dirname $0)/common.sh"
|
|||
./tools/run_tests --target=host -v \
|
||||
&& ./tools/clippy \
|
||||
&& ./tools/fmt --check \
|
||||
&& mdbook build ./docs/book"
|
||||
&& mdbook build ./docs/book \
|
||||
&& ./tools/cargo-doc"
|
||||
|
|
40
tools/cargo-doc
Executable file
40
tools/cargo-doc
Executable file
|
@ -0,0 +1,40 @@
|
|||
#!/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
|
||||
power-monitor-powerd
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
cargo doc \
|
||||
--manifest-path="${MANIFEST_PATH}" \
|
||||
--features="${features}" "$@"
|
Loading…
Reference in a new issue