summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/grit/grit/scons.py7
-rw-r--r--tools/grit/grit/tool/build.py20
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.