oprypin | 3b2fb20 | 2017-03-06 02:23:34 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| 3 | # |
| 4 | # Use of this source code is governed by a BSD-style license |
| 5 | # that can be found in the LICENSE file in the root of the source |
| 6 | # tree. An additional intellectual property rights grant can be found |
| 7 | # in the file PATENTS. All contributing project authors may |
| 8 | # be found in the AUTHORS file in the root of the source tree. |
| 9 | |
| 10 | """Downloads precompiled tools. |
| 11 | |
| 12 | These are checked into the repository as SHA-1 hashes (see *.sha1 files in |
| 13 | subdirectories). Note that chrome-webrtc-resources is a Google-internal bucket, |
| 14 | so please download and compile these tools manually if this script fails. |
| 15 | """ |
| 16 | |
| 17 | import os |
| 18 | import subprocess |
| 19 | import sys |
| 20 | |
| 21 | |
| 22 | SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 23 | |
| 24 | |
| 25 | def main(directories): |
| 26 | if not directories: |
| 27 | directories = [SCRIPT_DIR] |
| 28 | |
| 29 | for path in directories: |
| 30 | cmd = [ |
| 31 | 'download_from_google_storage', |
| 32 | '--directory', |
| 33 | '--num_threads=10', |
| 34 | '--bucket', 'chrome-webrtc-resources', |
| 35 | '--auto_platform', |
| 36 | '--recursive', |
| 37 | path, |
| 38 | ] |
| 39 | print 'Downloading precompiled tools...' |
| 40 | subprocess.check_call(cmd) |
| 41 | |
| 42 | |
| 43 | if __name__ == '__main__': |
| 44 | sys.exit(main(sys.argv[1:])) |