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