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

Side by Side Diff: copy_apprtc.py

Issue 1566143002: Fixing RemoveDirectory. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/webrtc/webrtc.DEPS@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 subprocess
12 import sys 12 import sys
13 13
14 import utils 14 import utils
15 15
16 16
17 def _ConfigureApprtcServerToDeveloperMode(app_yaml_path): 17 def _ConfigureApprtcServerToDeveloperMode(app_yaml_path):
18 if not os.path.exists(app_yaml_path): 18 if not os.path.exists(app_yaml_path):
19 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)
20 20
21 for line in fileinput.input(app_yaml_path, inplace=True): 21 for line in fileinput.input(app_yaml_path, inplace=True):
22 # 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
23 # disable them. 23 # disable them.
24 line = line.replace('BYPASS_JOIN_CONFIRMATION: false', 24 line = line.replace('BYPASS_JOIN_CONFIRMATION: false',
25 'BYPASS_JOIN_CONFIRMATION: true') 25 'BYPASS_JOIN_CONFIRMATION: true')
26 sys.stdout.write(line) 26 sys.stdout.write(line)
27 27
28 28
29 def RemoveDirectory(*path): 29 def RemoveDirectory(path):
30 if utils.GetPlatform() == 'win': 30 if utils.GetPlatform() == 'win':
31 # Allow clobbering of out dir using cygwin until crbug.com/567538 is fixed. 31 # Allow clobbering of out dir using cygwin until crbug.com/567538 is fixed.
32 drive, path = os.path.splitdrive(os.path.abspath(path)) 32 drive, path = os.path.splitdrive(os.path.abspath(path))
33 drive = drive.lower()[0] 33 drive = drive.lower()[0]
34 cygwin_full_path = '/cygdrive/%s%s' % (drive, path.replace('\\', '/')) 34 cygwin_full_path = '/cygdrive/%s%s' % (drive, path.replace('\\', '/'))
35 35
36 # Now it should be like /cygdrive/c/b/build/slave/Win7_Tester/build/src/out 36 # Now it should be like /cygdrive/c/b/build/slave/Win7_Tester/build/src/out
37 cmd = 'c:\\cygwin\\bin\\bash --login -c "rm -rf %s"' % cygwin_full_path 37 cmd = 'c:\\cygwin\\bin\\bash --login -c "rm -rf %s"' % cygwin_full_path
38 subprocess.check_call(cmd) 38 subprocess.check_call(cmd)
39 else: 39 else:
40 utils.RemoveDirectory(path) 40 utils.RemoveDirectory(path)
41 41
42 42
43 def main(): 43 def main():
44 target_dir = os.path.join('src', 'out', 'apprtc') 44 target_dir = os.path.join('src', 'out', 'apprtc')
45 RemoveDirectory(target_dir) 45 RemoveDirectory(target_dir)
46 shutil.copytree('apprtc', 46 shutil.copytree('apprtc',
47 target_dir, ignore=shutil.ignore_patterns('.svn', '.git')) 47 target_dir, ignore=shutil.ignore_patterns('.svn', '.git'))
48 48
49 app_yaml_path = os.path.join(target_dir, 'src', 'app_engine', 'app.yaml') 49 app_yaml_path = os.path.join(target_dir, 'src', 'app_engine', 'app.yaml')
50 _ConfigureApprtcServerToDeveloperMode(app_yaml_path) 50 _ConfigureApprtcServerToDeveloperMode(app_yaml_path)
51 51
52 52
53 if __name__ == '__main__': 53 if __name__ == '__main__':
54 sys.exit(main()) 54 sys.exit(main())
55 55
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698