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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
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 """Moves Apprtc to the out/ directory, where the browser test can find it."""
11
12 import fileinput
13 import os
14 import shutil
15 import subprocess
16 import sys
17
18 import utils
19
20
21 def _ConfigureApprtcServerToDeveloperMode(app_yaml_path):
22 if not os.path.exists(app_yaml_path):
23 return 'Expected app.yaml at %s.' % os.path.abspath(app_yaml_path)
24
25 for line in fileinput.input(app_yaml_path, inplace=True):
26 # We can't click past these in the firefox interop test, so
27 # disable them.
28 line = line.replace('BYPASS_JOIN_CONFIRMATION: false',
29 'BYPASS_JOIN_CONFIRMATION: true')
30 sys.stdout.write(line)
31
32
33 def RemoveDirectory(path):
34 if utils.GetPlatform() == 'win':
35 # Allow clobbering of out dir using cygwin until crbug.com/567538 is fixed.
36 drive, path = os.path.splitdrive(os.path.abspath(path))
37 drive = drive.lower()[0]
38 cygwin_full_path = '/cygdrive/%s%s' % (drive, path.replace('\\', '/'))
39
40 # Now it should be like /cygdrive/c/b/build/slave/Win7_Tester/build/src/out
41 cmd = 'c:\\cygwin\\bin\\bash --login -c "rm -rf %s"' % cygwin_full_path
42 subprocess.check_call(cmd)
43 else:
44 utils.RemoveDirectory(path)
45
46
47 def main():
48 target_dir = os.path.join('src', 'out', 'apprtc')
49 RemoveDirectory(target_dir)
50 shutil.copytree('apprtc',
51 target_dir, ignore=shutil.ignore_patterns('.svn', '.git'))
52
53 app_yaml_path = os.path.join(target_dir, 'out', 'app_engine', 'app.yaml')
54 _ConfigureApprtcServerToDeveloperMode(app_yaml_path)
55
56
57 if __name__ == '__main__':
58 sys.exit(main())
59
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698