OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Moves Apprtc to the out/ directory, where the browser test can find it.""" | 6 """Moves Apprtc to the out/ directory, where the browser test can find it.""" |
7 | 7 |
8 import fileinput | 8 import fileinput |
9 import os | 9 import os |
10 import shutil | 10 import shutil |
11 import subprocess | |
11 import sys | 12 import sys |
12 | 13 |
13 import utils | 14 import utils |
14 | 15 |
15 | 16 |
16 def _ConfigureApprtcServerToDeveloperMode(app_yaml_path): | 17 def _ConfigureApprtcServerToDeveloperMode(app_yaml_path): |
17 if not os.path.exists(app_yaml_path): | 18 if not os.path.exists(app_yaml_path): |
18 return 'Expected app.yaml at %s.' % os.path.abspath(app_yaml_path) | 19 return 'Expected app.yaml at %s.' % os.path.abspath(app_yaml_path) |
19 | 20 |
20 for line in fileinput.input(app_yaml_path, inplace=True): | 21 for line in fileinput.input(app_yaml_path, inplace=True): |
21 # We can't click past these in the firefox interop test, so | 22 # We can't click past these in the firefox interop test, so |
22 # disable them. | 23 # disable them. |
23 line = line.replace('BYPASS_JOIN_CONFIRMATION: false', | 24 line = line.replace('BYPASS_JOIN_CONFIRMATION: false', |
24 'BYPASS_JOIN_CONFIRMATION: true') | 25 'BYPASS_JOIN_CONFIRMATION: true') |
25 sys.stdout.write(line) | 26 sys.stdout.write(line) |
26 | 27 |
27 | 28 |
29 def RemoveDirectoryWithCygwinRmIfWindows(*path): | |
phoglund_chromium
2016/01/07 14:31:47
This name is misleading since it implies it only d
kjellander_chromium
2016/01/07 14:40:06
Done.
| |
30 if utils.GetPlatform() == 'win': | |
31 # Allow clobbering of out dir using cygwin until crbug.com/567538 is fixed. | |
32 full_path = os.path.abspath(path) | |
33 | |
34 # full_path is something like C:\b\build\slave\Win7_Tester\build\src\out | |
35 full_path = full_path[0].lower() + full_path[1:] # c:\b\... | |
phoglund_chromium
2016/01/07 14:31:47
This is alright, but you can use splitdrive to mak
kjellander_chromium
2016/01/07 14:40:06
Of course! Much better now.
| |
36 full_path = full_path.replace(':', '') # c\b\... | |
37 cygwin_full_path = '/cygdrive/' + full_path.replace('\\', '/') | |
38 | |
39 # Now it should be like /cygdrive/c/b/build/slave/Win7_Tester/build/src/out | |
40 cmd = 'c:\\cygwin\\bin\\bash --login -c "rm -rf %s"' % cygwin_full_path | |
41 subprocess.check_call(cmd) | |
42 else: | |
43 utils.RemoveDirectory(path) | |
44 | |
45 | |
28 def main(): | 46 def main(): |
29 target_dir = os.path.join('src', 'out', 'apprtc') | 47 target_dir = os.path.join('src', 'out', 'apprtc') |
30 utils.RemoveDirectory(target_dir) | 48 RemoveDirectoryWithCygwinRmIfWindows(target_dir) |
31 shutil.copytree('apprtc', | 49 shutil.copytree('apprtc', |
32 target_dir, ignore=shutil.ignore_patterns('.svn', '.git')) | 50 target_dir, ignore=shutil.ignore_patterns('.svn', '.git')) |
33 | 51 |
34 app_yaml_path = os.path.join(target_dir, 'src', 'app_engine', 'app.yaml') | 52 app_yaml_path = os.path.join(target_dir, 'src', 'app_engine', 'app.yaml') |
35 _ConfigureApprtcServerToDeveloperMode(app_yaml_path) | 53 _ConfigureApprtcServerToDeveloperMode(app_yaml_path) |
36 | 54 |
37 | 55 |
38 if __name__ == '__main__': | 56 if __name__ == '__main__': |
39 sys.exit(main()) | 57 sys.exit(main()) |
40 | 58 |
OLD | NEW |