blob: 2b463e004dd50c6cc82b6f61fb5de520f6ac3592 [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')
Oleh Prypin87301352018-04-04 09:00:09 +020033 utils.RunSubprocessWithRetry([sys.executable, download_apprtc_path,
34 output_dir])
mbonadei9e5841a2017-05-09 00:13:47 -070035
oprypin1d7392a2017-05-16 05:36:15 -070036 build_apprtc_path = os.path.join(SCRIPT_DIR, 'build_apprtc.py')
Oleh Prypin8058fbb2018-04-04 10:04:46 +020037 apprtc_dir = os.path.join(output_dir, 'apprtc')
mbonadei9e5841a2017-05-09 00:13:47 -070038 go_dir = os.path.join(output_dir, 'go')
39 collider_dir = os.path.join(output_dir, 'collider')
Oleh Prypin87301352018-04-04 09:00:09 +020040 utils.RunSubprocessWithRetry([sys.executable, build_apprtc_path,
Oleh Prypin8058fbb2018-04-04 10:04:46 +020041 apprtc_dir, go_dir, collider_dir])
mbonadei9e5841a2017-05-09 00:13:47 -070042
43
44if __name__ == '__main__':
45 sys.exit(main(sys.argv))