blob: 123fd3a4a563583b08e30481f7c490145923a3f4 [file] [log] [blame]
oprypin3b2fb202017-03-06 02:23:34 -08001#!/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
12These are checked into the repository as SHA-1 hashes (see *.sha1 files in
13subdirectories). Note that chrome-webrtc-resources is a Google-internal bucket,
14so please download and compile these tools manually if this script fails.
15"""
16
17import os
Henrik Kjellander44ba5e52017-10-13 06:06:25 +000018import subprocess
oprypin3b2fb202017-03-06 02:23:34 -080019import sys
20
21
22SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
Henrik Kjellander44ba5e52017-10-13 06:06:25 +000023# Needed to properly resolve PATH and executable extensions on Windows.
24USE_SHELL = sys.platform == 'win32'
oprypin3b2fb202017-03-06 02:23:34 -080025
26
27def main(directories):
28 if not directories:
29 directories = [SCRIPT_DIR]
30
31 for path in directories:
32 cmd = [
Henrik Kjellander44ba5e52017-10-13 06:06:25 +000033 'download_from_google_storage',
oprypin3b2fb202017-03-06 02:23:34 -080034 '--directory',
35 '--num_threads=10',
36 '--bucket', 'chrome-webrtc-resources',
37 '--auto_platform',
38 '--recursive',
39 path,
40 ]
41 print 'Downloading precompiled tools...'
Henrik Kjellander44ba5e52017-10-13 06:06:25 +000042 subprocess.check_call(cmd, shell=USE_SHELL)
oprypin3b2fb202017-03-06 02:23:34 -080043
44
45if __name__ == '__main__':
46 sys.exit(main(sys.argv[1:]))