1#!/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 25 26def main(argv): 27 if len(argv) == 1: 28 return 'Usage %s <output_dir>' % argv[0] 29 30 output_dir = os.path.abspath(argv[1]) 31 32 download_apprtc_path = os.path.join(SCRIPT_DIR, 'download_apprtc.py') 33 utils.RunSubprocessWithRetry([sys.executable, download_apprtc_path, 34 output_dir]) 35 36 build_apprtc_path = os.path.join(SCRIPT_DIR, 'build_apprtc.py') 37 apprtc_dir = os.path.join(output_dir, 'apprtc') 38 go_dir = os.path.join(output_dir, 'go') 39 collider_dir = os.path.join(output_dir, 'collider') 40 utils.RunSubprocessWithRetry([sys.executable, build_apprtc_path, 41 apprtc_dir, go_dir, collider_dir]) 42 43 44if __name__ == '__main__': 45 sys.exit(main(sys.argv)) 46