Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: webrtc/tools/testing/copy_apprtc.py

Issue 2861653005: Moving scripts to download and build apprtc/collider. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/tools/testing/copy_apprtc.py
diff --git a/webrtc/tools/testing/copy_apprtc.py b/webrtc/tools/testing/copy_apprtc.py
new file mode 100755
index 0000000000000000000000000000000000000000..85efd07b89d42d5d769aefa92105072783acf3dd
--- /dev/null
+++ b/webrtc/tools/testing/copy_apprtc.py
@@ -0,0 +1,59 @@
+#!/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.
+
+"""Moves Apprtc to the out/ directory, where the browser test can find it."""
+
+import fileinput
+import os
+import shutil
+import subprocess
+import sys
+
+import utils
+
+
+def _ConfigureApprtcServerToDeveloperMode(app_yaml_path):
+ if not os.path.exists(app_yaml_path):
+ return 'Expected app.yaml at %s.' % os.path.abspath(app_yaml_path)
+
+ for line in fileinput.input(app_yaml_path, inplace=True):
+ # We can't click past these in the firefox interop test, so
+ # disable them.
+ line = line.replace('BYPASS_JOIN_CONFIRMATION: false',
+ 'BYPASS_JOIN_CONFIRMATION: true')
+ sys.stdout.write(line)
+
+
+def RemoveDirectory(path):
+ if utils.GetPlatform() == 'win':
+ # Allow clobbering of out dir using cygwin until crbug.com/567538 is fixed.
+ drive, path = os.path.splitdrive(os.path.abspath(path))
+ drive = drive.lower()[0]
+ cygwin_full_path = '/cygdrive/%s%s' % (drive, path.replace('\\', '/'))
+
+ # Now it should be like /cygdrive/c/b/build/slave/Win7_Tester/build/src/out
+ cmd = 'c:\\cygwin\\bin\\bash --login -c "rm -rf %s"' % cygwin_full_path
+ subprocess.check_call(cmd)
+ else:
+ utils.RemoveDirectory(path)
+
+
+def main():
+ target_dir = os.path.join('src', 'out', 'apprtc')
+ RemoveDirectory(target_dir)
+ shutil.copytree('apprtc',
+ target_dir, ignore=shutil.ignore_patterns('.svn', '.git'))
+
+ app_yaml_path = os.path.join(target_dir, 'out', 'app_engine', 'app.yaml')
+ _ConfigureApprtcServerToDeveloperMode(app_yaml_path)
+
+
+if __name__ == '__main__':
+ sys.exit(main())
+

Powered by Google App Engine
This is Rietveld 408576698