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

Side by Side Diff: build/android/gyp/copy_ex.py

Issue 1424983004: Using copy_ex to copy assets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: using copy_ex Created 5 years, 1 month 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 | « base/android/java/src/org/chromium/base/ApkAssets.java ('k') | chromecast/chromecast.gyp » ('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/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2014 The Chromium Authors. All rights reserved. 3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Copies files to a directory.""" 7 """Copies files to a directory."""
8 8
9 import itertools 9 import itertools
10 import optparse 10 import optparse
(...skipping 14 matching lines...) Expand all
25 return result 25 return result
26 26
27 def CopyFile(f, dest, deps): 27 def CopyFile(f, dest, deps):
28 """Copy file or directory and update deps.""" 28 """Copy file or directory and update deps."""
29 if os.path.isdir(f): 29 if os.path.isdir(f):
30 shutil.copytree(f, os.path.join(dest, os.path.basename(f))) 30 shutil.copytree(f, os.path.join(dest, os.path.basename(f)))
31 deps.extend(_get_all_files(f)) 31 deps.extend(_get_all_files(f))
32 else: 32 else:
33 shutil.copy(f, dest) 33 shutil.copy(f, dest)
34 deps.append(f) 34 deps.append(f)
35 # TODO(michaelbai): Remove when crbug.com/547235 fixed.
36 sys.stderr.write("CopyFile: " + f + " " + dest + "\n")
jbudorick 2015/10/29 13:06:14 We do not want this in the build output.
michaelbai 2015/10/29 14:56:44 Let's keep it for a while, I did see 'CopyFile' bu
jbudorick 2015/10/29 14:57:29 No. Having builds making unnecessary noise is a pr
jbudorick 2015/10/29 15:03:19 Specifically, there'd be a crbug within hours abou
michaelbai 2015/10/29 17:00:45 Removed
35 37
36 def DoCopy(options, deps): 38 def DoCopy(options, deps):
37 """Copy files or directories given in options.files and update deps.""" 39 """Copy files or directories given in options.files and update deps."""
38 files = list(itertools.chain.from_iterable(build_utils.ParseGypList(f) 40 files = list(itertools.chain.from_iterable(build_utils.ParseGypList(f)
39 for f in options.files)) 41 for f in options.files))
40 42
41 for f in files: 43 for f in files:
42 if os.path.isdir(f) and not options.clear: 44 if os.path.isdir(f) and not options.clear:
43 print ('To avoid stale files you must use --clear when copying ' 45 print ('To avoid stale files you must use --clear when copying '
44 'directories') 46 'directories')
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 options.depfile, 110 options.depfile,
109 deps + build_utils.GetPythonDependencies()) 111 deps + build_utils.GetPythonDependencies())
110 112
111 if options.stamp: 113 if options.stamp:
112 build_utils.Touch(options.stamp) 114 build_utils.Touch(options.stamp)
113 115
114 116
115 if __name__ == '__main__': 117 if __name__ == '__main__':
116 sys.exit(main(sys.argv[1:])) 118 sys.exit(main(sys.argv[1:]))
117 119
OLDNEW
« no previous file with comments | « base/android/java/src/org/chromium/base/ApkAssets.java ('k') | chromecast/chromecast.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698