Chromium Code Reviews| Index: webrtc/tools/testing/setup_apprtc.py |
| diff --git a/webrtc/tools/testing/setup_apprtc.py b/webrtc/tools/testing/setup_apprtc.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5cb36b5014c73002bb3504df284b0ebb29d1befd |
| --- /dev/null |
| +++ b/webrtc/tools/testing/setup_apprtc.py |
| @@ -0,0 +1,49 @@ |
| +#!/usr/bin/env python |
| +# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| +# |
| +# Use of this source code is governed by a BSD-style license |
| +# that can be found in the LICENSE file in the root of the source |
| +# tree. An additional intellectual property rights grant can be found |
| +# in the file PATENTS. All contributing project authors may |
| +# be found in the AUTHORS file in the root of the source tree. |
| + |
| +"""This script sets up AppRTC and its dependencies. |
| + |
| +Requires that depot_tools is installed and in the PATH. This script expects |
| +to run with Chrome's base dir as the working directory, e.g. where the .gclient |
|
kjellander_webrtc
2017/05/05 13:32:22
I don't think we should have this limitation. Let'
mbonadei
2017/05/08 12:01:09
Done, now all the scripts are explicit about this.
|
| +file is. This is what should happen if this script is invoked as a hook action. |
| +""" |
| + |
| +import os |
| +import sys |
| + |
| +import utils |
| + |
|
kjellander_webrtc
2017/05/05 13:32:22
nit: Two blank lines between top-level definitions
mbonadei
2017/05/08 12:01:09
Done.
|
| +def main(argv): |
| + if len(argv) == 1: |
| + return 'Usage %s <path to root directory (where .gclient lives)' % argv[0] |
|
kjellander_webrtc
2017/05/05 13:32:22
I assume the dir argument passed is just where it'
mbonadei
2017/05/08 12:01:09
Done. There was an assumption about the top level
|
| + |
| + webrtc_root_path = argv[1] |
| + script_path = os.path.join('src', 'webrtc', 'tools', 'testing') |
|
kjellander_webrtc
2017/05/05 13:32:22
as mentioned above, use SCRIPT_DIR or similar for
mbonadei
2017/05/08 12:01:09
Done.
|
| + |
| + apprtc_appengine_mercurial_path = os.path.join( |
| + script_path, 'download_apprtc_appengine_and_mercurial.py') |
| + utils.RunSubprocessWithRetry([apprtc_appengine_mercurial_path, |
| + webrtc_root_path]) |
| + |
| + download_golang_path = os.path.join(script_path, 'download_golang.py') |
| + utils.RunSubprocessWithRetry([download_golang_path, webrtc_root_path]) |
| + |
| + copy_apprtc_path = os.path.join(script_path, 'copy_apprtc.py') |
| + utils.RunSubprocessWithRetry([copy_apprtc_path]) |
| + |
| + build_mercurial_path = os.path.join(script_path, 'build_mercurial_local.py') |
|
kjellander_webrtc
2017/05/05 13:32:22
I guess these build_ scripts doesn't allow us to c
mbonadei
2017/05/08 12:01:09
Done.
|
| + utils.RunSubprocessWithRetry([build_mercurial_path]) |
| + |
| + build_apprtc_collider_path = os.path.join(script_path, |
| + 'build_apprtc_collider.py') |
| + utils.RunSubprocessWithRetry([build_apprtc_collider_path]) |
| + |
| + |
| +if __name__ == '__main__': |
| + sys.exit(main(sys.argv)) |