2023-04-27 19:46:20 +00:00
|
|
|
#!/usr/bin/env python3
|
2022-09-13 17:55:17 +00:00
|
|
|
# Copyright 2021 The ChromiumOS Authors
|
2021-11-29 03:36:40 +00:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2023-04-27 19:46:20 +00:00
|
|
|
from typing import Optional
|
|
|
|
|
|
|
|
from impl.common import CROSVM_ROOT, chdir, cmd, quoted, run_main
|
2021-11-29 03:36:40 +00:00
|
|
|
|
|
|
|
# Build cargo-doc
|
|
|
|
# $ ./tools/cargo-doc --target-dir /path/to/dir
|
|
|
|
|
2023-04-27 19:46:20 +00:00
|
|
|
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)
|