OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license | 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 | 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 | 6 # tree. An additional intellectual property rights grant can be found |
7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
9 | 9 |
10 """This script sets up AppRTC and its dependencies. | 10 """This script sets up AppRTC and its dependencies. |
11 | 11 |
12 Requires that depot_tools is installed and in the PATH. | 12 Requires that depot_tools is installed and in the PATH. |
13 | 13 |
14 It will put the result under <output_dir>/collider. | 14 It will put the result under <output_dir>/collider. |
15 """ | 15 """ |
16 | 16 |
17 import os | 17 import os |
18 import sys | 18 import sys |
19 | 19 |
20 import utils | 20 import utils |
21 | 21 |
22 | 22 |
23 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 23 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
24 | 24 |
| 25 |
25 def main(argv): | 26 def main(argv): |
26 if len(argv) == 1: | 27 if len(argv) == 1: |
27 return 'Usage %s <output_dir>' % argv[0] | 28 return 'Usage %s <output_dir>' % argv[0] |
28 | 29 |
29 output_dir = argv[1] | 30 output_dir = os.path.abspath(argv[1]) |
30 apprtc_appengine_mercurial_path = os.path.join( | |
31 SCRIPT_DIR, 'download_apprtc_appengine_and_mercurial.py') | |
32 utils.RunSubprocessWithRetry([apprtc_appengine_mercurial_path, | |
33 output_dir]) | |
34 | 31 |
35 download_golang_path = os.path.join(SCRIPT_DIR, 'download_golang.py') | 32 download_apprtc_path = os.path.join(SCRIPT_DIR, 'download_apprtc.py') |
36 utils.RunSubprocessWithRetry([download_golang_path, output_dir]) | 33 utils.RunSubprocessWithRetry([download_apprtc_path, output_dir]) |
37 | 34 |
38 build_mercurial_path = os.path.join(SCRIPT_DIR, 'build_mercurial_local.py') | 35 build_apprtc_path = os.path.join(SCRIPT_DIR, 'build_apprtc.py') |
39 hg_dir = os.path.join(output_dir, 'mercurial') | |
40 utils.RunSubprocessWithRetry([build_mercurial_path, hg_dir]) | |
41 | |
42 build_apprtc_collider_path = os.path.join(SCRIPT_DIR, | |
43 'build_apprtc_collider.py') | |
44 apprtc_src_dir = os.path.join(output_dir, 'apprtc', 'src') | 36 apprtc_src_dir = os.path.join(output_dir, 'apprtc', 'src') |
45 go_dir = os.path.join(output_dir, 'go') | 37 go_dir = os.path.join(output_dir, 'go') |
46 collider_dir = os.path.join(output_dir, 'collider') | 38 collider_dir = os.path.join(output_dir, 'collider') |
47 utils.RunSubprocessWithRetry([build_apprtc_collider_path, apprtc_src_dir, | 39 utils.RunSubprocessWithRetry([build_apprtc_path, apprtc_src_dir, |
48 go_dir, hg_dir, collider_dir]) | 40 go_dir, collider_dir]) |
49 | 41 |
50 | 42 |
51 if __name__ == '__main__': | 43 if __name__ == '__main__': |
52 sys.exit(main(sys.argv)) | 44 sys.exit(main(sys.argv)) |
OLD | NEW |