blob: 387ba694a3b5f1aaf0cec1fbd3468e165242c012 [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.
mbonadei9e5841a2017-05-09 00:13:47 -07009"""This script sets up AppRTC and its dependencies.
10
11Requires that depot_tools is installed and in the PATH.
12
13It will put the result under <output_dir>/collider.
14"""
15
16import os
17import sys
18
19import utils
20
mbonadei9e5841a2017-05-09 00:13:47 -070021SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
22
oprypin1d7392a2017-05-16 05:36:15 -070023
mbonadei9e5841a2017-05-09 00:13:47 -070024def main(argv):
Mirko Bonadei8cc66952020-10-30 10:13:45 +010025 if len(argv) == 1:
26 return 'Usage %s <output_dir>' % argv[0]
mbonadei9e5841a2017-05-09 00:13:47 -070027
Mirko Bonadei8cc66952020-10-30 10:13:45 +010028 output_dir = os.path.abspath(argv[1])
mbonadei9e5841a2017-05-09 00:13:47 -070029
Mirko Bonadei8cc66952020-10-30 10:13:45 +010030 download_apprtc_path = os.path.join(SCRIPT_DIR, 'download_apprtc.py')
31 utils.RunSubprocessWithRetry(
32 [sys.executable, download_apprtc_path, output_dir])
mbonadei9e5841a2017-05-09 00:13:47 -070033
Mirko Bonadei8cc66952020-10-30 10:13:45 +010034 build_apprtc_path = os.path.join(SCRIPT_DIR, 'build_apprtc.py')
35 apprtc_dir = os.path.join(output_dir, 'apprtc')
36 go_dir = os.path.join(output_dir, 'go')
37 collider_dir = os.path.join(output_dir, 'collider')
38 utils.RunSubprocessWithRetry(
39 [sys.executable, build_apprtc_path, apprtc_dir, go_dir, collider_dir])
mbonadei9e5841a2017-05-09 00:13:47 -070040
41
42if __name__ == '__main__':
Mirko Bonadei8cc66952020-10-30 10:13:45 +010043 sys.exit(main(sys.argv))