mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 05:03:05 +00:00
49ba9f2df6
This lets us use the common arg parsing infrastructure, and it should work on Windows (as opposed to the previous bash script). BUG=b:267672683 TEST=tools/cargo-doc TEST=tools/cargo-doc --target-dir=/tmp/crosvm-doc Change-Id: Ib56f4d28965d32ea01a9aa55d7840edfb71f3d59 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4483471 Reviewed-by: Dennis Kempin <denniskempin@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
31 lines
777 B
Python
Executable file
31 lines
777 B
Python
Executable file
#!/usr/bin/env python3
|
|
# Copyright 2021 The ChromiumOS Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
from typing import Optional
|
|
|
|
from impl.common import CROSVM_ROOT, chdir, cmd, quoted, run_main
|
|
|
|
# Build cargo-doc
|
|
# $ ./tools/cargo-doc --target-dir /path/to/dir
|
|
|
|
cargo = cmd("cargo").with_color_flag()
|
|
|
|
|
|
def main(target_dir: Optional[str] = None, *extra_args: str):
|
|
chdir(CROSVM_ROOT)
|
|
cargo(
|
|
"doc",
|
|
"--workspace",
|
|
"--no-deps",
|
|
"--exclude=crosvm-fuzz",
|
|
"--features=all-x86_64",
|
|
"--document-private-items",
|
|
quoted(f"--target-dir={target_dir}") if target_dir else None,
|
|
*extra_args,
|
|
).fg()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
run_main(main)
|