download_doclava.py 931 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python3
  2. # Copyright 2016 The Chromium Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """Minimal tool to download doclava from Google storage when building for
  6. Android."""
  7. import os
  8. import subprocess
  9. import sys
  10. def main():
  11. # Some Windows bots inadvertently have third_party/android_sdk installed,
  12. # but are unable to run download_from_google_storage because depot_tools
  13. # is not in their path, so avoid failure and bail.
  14. if sys.platform == 'win32':
  15. return 0
  16. subprocess.check_call([
  17. 'download_from_google_storage',
  18. '--no_resume',
  19. '--no_auth',
  20. '--bucket', 'chromium-doclava',
  21. '--extract',
  22. '-s',
  23. os.path.join(os.path.dirname(__file__), '..', '..', 'buildtools',
  24. 'android', 'doclava.tar.gz.sha1')])
  25. return 0
  26. if __name__ == '__main__':
  27. sys.exit(main())