mbonadei | 9e5841a | 2017-05-09 00:13:47 -0700 | [diff] [blame] | 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. |
mbonadei | 9e5841a | 2017-05-09 00:13:47 -0700 | [diff] [blame] | 9 | """This script sets up AppRTC and its dependencies. |
| 10 | |
| 11 | Requires that depot_tools is installed and in the PATH. |
| 12 | |
| 13 | It will put the result under <output_dir>/collider. |
| 14 | """ |
| 15 | |
| 16 | import os |
| 17 | import sys |
| 18 | |
| 19 | import utils |
| 20 | |
mbonadei | 9e5841a | 2017-05-09 00:13:47 -0700 | [diff] [blame] | 21 | SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 22 | |
oprypin | 1d7392a | 2017-05-16 05:36:15 -0700 | [diff] [blame] | 23 | |
mbonadei | 9e5841a | 2017-05-09 00:13:47 -0700 | [diff] [blame] | 24 | def main(argv): |
Mirko Bonadei | 8cc6695 | 2020-10-30 10:13:45 +0100 | [diff] [blame] | 25 | if len(argv) == 1: |
| 26 | return 'Usage %s <output_dir>' % argv[0] |
mbonadei | 9e5841a | 2017-05-09 00:13:47 -0700 | [diff] [blame] | 27 | |
Mirko Bonadei | 8cc6695 | 2020-10-30 10:13:45 +0100 | [diff] [blame] | 28 | output_dir = os.path.abspath(argv[1]) |
mbonadei | 9e5841a | 2017-05-09 00:13:47 -0700 | [diff] [blame] | 29 | |
Mirko Bonadei | 8cc6695 | 2020-10-30 10:13:45 +0100 | [diff] [blame] | 30 | download_apprtc_path = os.path.join(SCRIPT_DIR, 'download_apprtc.py') |
| 31 | utils.RunSubprocessWithRetry( |
| 32 | [sys.executable, download_apprtc_path, output_dir]) |
mbonadei | 9e5841a | 2017-05-09 00:13:47 -0700 | [diff] [blame] | 33 | |
Mirko Bonadei | 8cc6695 | 2020-10-30 10:13:45 +0100 | [diff] [blame] | 34 | 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]) |
mbonadei | 9e5841a | 2017-05-09 00:13:47 -0700 | [diff] [blame] | 40 | |
| 41 | |
| 42 | if __name__ == '__main__': |
Mirko Bonadei | 8cc6695 | 2020-10-30 10:13:45 +0100 | [diff] [blame] | 43 | sys.exit(main(sys.argv)) |