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

Unified Diff: tools/grit/grit/tool/build.py

Issue 24011: chrome_resources take 2 (Closed)
Patch Set: rebase Created 11 years, 10 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 | « tools/grit/grit/scons.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/tool/build.py
diff --git a/tools/grit/grit/tool/build.py b/tools/grit/grit/tool/build.py
index ab898093b7fde2acbf9182636e32ed4b188284d2..9e45859e4f10fff19a756af359c60f460391de3b 100644
--- a/tools/grit/grit/tool/build.py
+++ b/tools/grit/grit/tool/build.py
@@ -10,6 +10,7 @@ SCons build system.
import os
import getopt
import types
+import shutil
import sys
from grit import grd_reader
@@ -189,6 +190,20 @@ are exported to translation interchange files (e.g. XMB files), etc.
self.ProcessNode(self.res, output, outfile)
outfile.close()
+
+ # Generate the header and also put a copy in a grit subdir. We do this
+ # so our include paths can have 'grit' in them.
+ # TODO(tc): Once we transition all the #include lines to have 'grit' in
+ # the path, we can only generate one header.
+ if output.GetType() == 'rc_header':
+ dir_name, header_name = os.path.split(output.GetOutputFilename())
+ dir_name = os.path.join(dir_name, 'grit')
+ try:
+ os.makedirs(dir_name)
+ except OSError, e:
+ pass
+ shutil.copy2(output.GetOutputFilename(),
+ os.path.join(dir_name, header_name))
self.VerboseOut(' done.\n')
# Print warnings if there are any duplicate shortcuts.
« no previous file with comments | « tools/grit/grit/scons.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698