blob: 697d5031d8bb8151fa4167cf20d153a4ee4d45cf [file] [log] [blame]
mbonadei9e5841a2017-05-09 00:13:47 -07001#!/usr/bin/env python
2# Copyright (c) 2017 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"""This script sets up AppRTC and its dependencies.
11
12Requires that depot_tools is installed and in the PATH.
13
14It will put the result under <output_dir>/collider.
15"""
16
17import os
18import sys
19
20import utils
21
22
23SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
24
oprypin1d7392a2017-05-16 05:36:15 -070025
mbonadei9e5841a2017-05-09 00:13:47 -070026def main(argv):
27 if len(argv) == 1:
28 return 'Usage %s <output_dir>' % argv[0]
29
oprypin1d7392a2017-05-16 05:36:15 -070030 output_dir = os.path.abspath(argv[1])
mbonadei9e5841a2017-05-09 00:13:47 -070031
oprypin1d7392a2017-05-16 05:36:15 -070032 download_apprtc_path = os.path.join(SCRIPT_DIR, 'download_apprtc.py')
33 utils.RunSubprocessWithRetry([download_apprtc_path, output_dir])
mbonadei9e5841a2017-05-09 00:13:47 -070034
oprypin1d7392a2017-05-16 05:36:15 -070035 build_apprtc_path = os.path.join(SCRIPT_DIR, 'build_apprtc.py')
mbonadei9e5841a2017-05-09 00:13:47 -070036 apprtc_src_dir = os.path.join(output_dir, 'apprtc', 'src')
37 go_dir = os.path.join(output_dir, 'go')
38 collider_dir = os.path.join(output_dir, 'collider')
oprypin1d7392a2017-05-16 05:36:15 -070039 utils.RunSubprocessWithRetry([build_apprtc_path, apprtc_src_dir,
40 go_dir, collider_dir])
mbonadei9e5841a2017-05-09 00:13:47 -070041
42
43if __name__ == '__main__':
44 sys.exit(main(sys.argv))