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

Unified Diff: build/win/clobber_generated_headers.py

Issue 255015: The buildbots compile into src/build/{Debug,Release} but this script (Closed)
Patch Set: rebase Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/win/clobber_generated_headers.py
diff --git a/build/win/clobber_generated_headers.py b/build/win/clobber_generated_headers.py
index 8c5521f194e8221489cae83fb49d6cf72bf333ba..d6bae89dbe93fca7d8c03af4907cb51527e9d731 100644
--- a/build/win/clobber_generated_headers.py
+++ b/build/win/clobber_generated_headers.py
@@ -43,21 +43,25 @@ for path in sys.argv[1:]:
continue
output_files = [node.GetOutputFilename() for node in root.GetOutputFiles()]
output_headers = [file for file in output_files if file.endswith('.h')]
- for build_type in ('Debug', 'Release'):
- build_path = os.path.join(_SRC_PATH, 'chrome', build_type)
-
- # We guess target file output based on path of the grd file (the first
- # path component after 'src').
- intermediate_path = os.path.join(build_path, 'obj',
- 'global_intermediate', path_components[1])
-
- for header in output_headers:
- full_path = os.path.normpath(os.path.join(intermediate_path, header))
- if os.path.exists(full_path):
- try:
- os.remove(full_path)
- except OSError, e:
+ # Build output can be in any subdirectory of src.
+ paths = [d for d in os.listdir(_SRC_PATH) if
+ os.path.isdir(os.path.join(_SRC_PATH, d))]
+ for out_dir in paths:
+ for build_type in ('Debug', 'Release'):
+ build_path = os.path.join(_SRC_PATH, out_dir, build_type)
+
+ # We guess target file output based on path of the grd file (the first
+ # path component after 'src').
+ intermediate_path = os.path.join(build_path, 'obj',
+ 'global_intermediate', path_components[1])
+
+ for header in output_headers:
+ full_path = os.path.normpath(os.path.join(intermediate_path, header))
+ if os.path.exists(full_path):
+ try:
+ os.remove(full_path)
+ except OSError, e:
fmt = 'Could not remove %s: %s. Continuing.\n'
sys.stderr.write(fmt % (full_path, e))
- else:
- print 'Clobbered ' + full_path
+ else:
+ print 'Clobbered ' + full_path
« 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