diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 23:38:55 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 23:38:55 +0000 |
commit | 226558c339b10721fd3266048a8f0ecb65c13605 (patch) | |
tree | 9c8762ce83b120b554bc1deaae5de828f9a34889 /tools/grit | |
parent | 5f129def8edfb24581d13eee26029192c5c6c75e (diff) | |
download | chromium_src-226558c339b10721fd3266048a8f0ecb65c13605.zip chromium_src-226558c339b10721fd3266048a8f0ecb65c13605.tar.gz chromium_src-226558c339b10721fd3266048a8f0ecb65c13605.tar.bz2 |
Final step in converting all grit includes to have grit in the path.
Fixes some linux/mac issues that were pending and fix up the scons build to
expect the file in the grit subdir.
BUG=7537
Review URL: http://codereview.chromium.org/28035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10306 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/grit')
-rw-r--r-- | tools/grit/grit/scons.py | 7 | ||||
-rw-r--r-- | tools/grit/grit/tool/build.py | 20 |
2 files changed, 5 insertions, 22 deletions
diff --git a/tools/grit/grit/scons.py b/tools/grit/grit/scons.py index ba1c6c12f..946c72c 100644 --- a/tools/grit/grit/scons.py +++ b/tools/grit/grit/scons.py @@ -84,9 +84,6 @@ def _Emitter(target, source, env): target = [] lang_folders = {} - # TODO(tc): new_header_output is a hack while we migrate to - # grit_derived_sources/grit/ as the new output dir for headers. - new_header_output = None # Add all explicitly-specified output files for output in grd.GetOutputFiles(): path = os.path.join(base_dir, output.GetFilename()) @@ -94,7 +91,6 @@ def _Emitter(target, source, env): if path.endswith('.h'): path, filename = os.path.split(path) - new_header_output = os.path.join(path, 'grit', filename) if _IsDebugEnabled(): print "GRIT: Added target %s" % path if output.attrs['lang'] != '': @@ -115,9 +111,6 @@ def _Emitter(target, source, env): if _IsDebugEnabled(): print "GRIT: Added target %s" % path - if new_header_output: - target.append(new_header_output) - # GRIT is not thread safe so we should only build one grit target at a time. # We tell scons about this by making a fake side effect target. env.SideEffect('grit_lock', target) diff --git a/tools/grit/grit/tool/build.py b/tools/grit/grit/tool/build.py index 9e45859..e3e43d6 100644 --- a/tools/grit/grit/tool/build.py +++ b/tools/grit/grit/tool/build.py @@ -10,7 +10,6 @@ SCons build system. import os import getopt import types -import shutil import sys from grit import grd_reader @@ -173,6 +172,11 @@ are exported to translation interchange files (e.g. XMB files), etc. encoding = 'cp1252' else: encoding = 'utf_16' + + # Make the output directory if it doesn't exist. + outdir = os.path.split(output.GetOutputFilename())[0] + if not os.path.exists(outdir): + os.path.makedirs(outdir) outfile = self.fo_create(output.GetOutputFilename(), 'wb') if output.GetType() != 'data_package': @@ -188,22 +192,8 @@ are exported to translation interchange files (e.g. XMB files), etc. # Iterate in-order through entire resource tree, calling formatters on # the entry into a node and on exit out of it. 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. |