1
0

cargo-doc 777 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env python3
  2. # Copyright 2021 The ChromiumOS Authors
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. from typing import Optional
  6. from impl.common import CROSVM_ROOT, chdir, cmd, quoted, run_main
  7. # Build cargo-doc
  8. # $ ./tools/cargo-doc --target-dir /path/to/dir
  9. cargo = cmd("cargo").with_color_flag()
  10. def main(target_dir: Optional[str] = None, *extra_args: str):
  11. chdir(CROSVM_ROOT)
  12. cargo(
  13. "doc",
  14. "--workspace",
  15. "--no-deps",
  16. "--exclude=crosvm-fuzz",
  17. "--features=all-x86_64",
  18. "--document-private-items",
  19. quoted(f"--target-dir={target_dir}") if target_dir else None,
  20. *extra_args,
  21. ).fg()
  22. if __name__ == "__main__":
  23. run_main(main)