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

Unified Diff: grit/tool/build.py

Issue 691873002: Add support to override output_all_resource_defines from command line. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Created 6 years, 2 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
Index: grit/tool/build.py
diff --git a/grit/tool/build.py b/grit/tool/build.py
index e72724f90b2411de7dd60b6751a52d133b6b2a6b..3c0ba3ef8e2d79d499568cb834c78ec671154218 100644
--- a/grit/tool/build.py
+++ b/grit/tool/build.py
@@ -123,8 +123,11 @@ are exported to translation interchange files (e.g. XMB files), etc.
depfile = None
depdir = None
rc_header_format = None
+ output_all_resource_defines = None
(own_opts, args) = getopt.getopt(args, 'a:o:D:E:f:w:t:h:',
- ('depdir=','depfile=','assert-file-list='))
+ ('depdir=','depfile=','assert-file-list=',
+ 'output-all-resource-defines',
newt (away) 2014/10/30 20:16:20 Alternatively, this could accept an argument, e.g.
lliabraa 2014/10/31 11:33:13 I think this is a little more explicit because it
+ 'nooutput-all-resource-defines',))
for (key, val) in own_opts:
if key == '-a':
assert_output_files.append(val)
@@ -146,6 +149,10 @@ are exported to translation interchange files (e.g. XMB files), etc.
first_ids_file = val
elif key == '-w':
whitelist_filenames.append(val)
+ elif key == '--output-all-resource-defines':
+ output_all_resource_defines = True
+ elif key == '--nooutput-all-resource-defines':
+ output_all_resource_defines = False
elif key == '-t':
target_platform = val
elif key == '-h':
@@ -178,6 +185,12 @@ are exported to translation interchange files (e.g. XMB files), etc.
first_ids_file=first_ids_file,
defines=self.defines,
target_platform=target_platform)
+
+ # If the output_all_resource_defines option is specified, override the value
+ # found in the grd file.
+ if output_all_resource_defines is not None:
+ self.res.SetShouldOutputAllResourceDefines(output_all_resource_defines)
+
# Set an output context so that conditionals can use defines during the
# gathering stage; we use a dummy language here since we are not outputting
# a specific language.
« no previous file with comments | « grit/node/misc.py ('k') | grit/tool/build_unittest.py » ('j') | grit/tool/build_unittest.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698