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

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: fix .grd, add testOutputAllResourceDefinesFalse Created 6 years, 1 month 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 186c8b1876f4393fb7b8c48791576f63d33ac508..c3c1affbb88be34dea7cc5089569d6d05491819d 100644
--- a/grit/tool/build.py
+++ b/grit/tool/build.py
@@ -104,6 +104,11 @@ Options:
and {numeric_id}. E.g. "#define {textual_id} {numeric_id}"
Otherwise it will use the default "#define SYMBOL 1234"
+ --output-all-resource-defines
+ --no-output-all-resource-defines If specified, overrides the value of the
+ output_all_resource_defines attribute of the root <grit>
+ element of the input .grd file.
+
Conditional inclusion of resources only affects the output of files which
control which resources get linked into a binary, e.g. it affects .rc files
meant for compilation but it does not affect resource header files (that define
@@ -123,8 +128,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',
+ 'no-output-all-resource-defines',))
for (key, val) in own_opts:
if key == '-a':
assert_output_files.append(val)
@@ -146,6 +154,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 == '--no-output-all-resource-defines':
+ output_all_resource_defines = False
elif key == '-t':
target_platform = val
elif key == '-h':
@@ -178,6 +190,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/testdata/whitelist_resources.grd ('k') | grit/tool/build_unittest.py » ('j') | grit_info.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698