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

Side by Side Diff: copy_apprtc.py

Issue 1566963004: Use cleanup with retry on Windows for all scripts. (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 | « build_apprtc_collider.py ('k') | utils.py » ('j') | 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 sys 11 import sys
12 12
13 import utils 13 import utils
14 14
15 15
16 def _ConfigureApprtcServerToDeveloperMode(app_yaml_path): 16 def _ConfigureApprtcServerToDeveloperMode(app_yaml_path):
17 if not os.path.exists(app_yaml_path): 17 if not os.path.exists(app_yaml_path):
18 return 'Expected app.yaml at %s.' % os.path.abspath(app_yaml_path) 18 return 'Expected app.yaml at %s.' % os.path.abspath(app_yaml_path)
19 19
20 for line in fileinput.input(app_yaml_path, inplace=True): 20 for line in fileinput.input(app_yaml_path, inplace=True):
21 # We can't click past these in the firefox interop test, so 21 # We can't click past these in the firefox interop test, so
22 # disable them. 22 # disable them.
23 line = line.replace('BYPASS_JOIN_CONFIRMATION: false', 23 line = line.replace('BYPASS_JOIN_CONFIRMATION: false',
24 'BYPASS_JOIN_CONFIRMATION: true') 24 'BYPASS_JOIN_CONFIRMATION: true')
25 sys.stdout.write(line) 25 sys.stdout.write(line)
26 26
27 27
28 def main(): 28 def main():
29 target_dir = os.path.join('src', 'out', 'apprtc') 29 target_dir = os.path.join('src', 'out', 'apprtc')
30 if utils.GetPlatform() is 'win': 30 utils.RemoveDirectory(target_dir)
31 # Windows shutil can't handle the long node.js paths when deleting;
32 # work around the problem.
33 os.system('rmdir /s /q %s' % target_dir)
34 else:
35 shutil.rmtree(target_dir, ignore_errors=True)
36 shutil.copytree('apprtc', 31 shutil.copytree('apprtc',
37 target_dir, ignore=shutil.ignore_patterns('.svn', '.git')) 32 target_dir, ignore=shutil.ignore_patterns('.svn', '.git'))
38 33
39 app_yaml_path = os.path.join(target_dir, 'src', 'app_engine', 'app.yaml') 34 app_yaml_path = os.path.join(target_dir, 'src', 'app_engine', 'app.yaml')
40 _ConfigureApprtcServerToDeveloperMode(app_yaml_path) 35 _ConfigureApprtcServerToDeveloperMode(app_yaml_path)
41 36
42 37
43 if __name__ == '__main__': 38 if __name__ == '__main__':
44 sys.exit(main()) 39 sys.exit(main())
45 40
OLDNEW
« no previous file with comments | « build_apprtc_collider.py ('k') | utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698