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

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

Issue 2690263004: Add option to GRIT to provide a resource ordering input file. (Closed)
Patch Set: Removed Mac resource ordering file. Created 3 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
Index: tools/grit/grit/tool/build.py
diff --git a/tools/grit/grit/tool/build.py b/tools/grit/grit/tool/build.py
index a5703b20bb66df63aaef3008eab56319e4963731..5203ae4af589bdfbabda12aa2f9b970554912ace 100755
--- a/tools/grit/grit/tool/build.py
+++ b/tools/grit/grit/tool/build.py
@@ -85,6 +85,13 @@ Options:
-o OUTPUTDIR Specify what directory output paths are relative to.
Defaults to the current directory.
+ -p FILE Specify a file containing a pre-determined mapping from
+ resource names to resource ids which will be used to assign
+ resource ids to those resources. Resources not found in this
+ file will assigned ids normally. The file is of the format:
Nico 2017/02/17 21:44:08 s/will/will be/ Have you considered if missing ID
Alexei Svitkine (slow) 2017/02/17 22:07:51 Done.
+ RESOURCE_ONE_NAME 123
+ RESOURCE_TWO_NAME 124
+
-D NAME[=VAL] Specify a C-preprocessor-like define NAME with optional
value VAL (defaults to 1) which will be used to control
conditional inclusion of resources.
@@ -146,6 +153,7 @@ are exported to translation interchange files (e.g. XMB files), etc.
def Run(self, opts, args):
self.output_directory = '.'
first_ids_file = None
+ predetermined_ids_file = None
whitelist_filenames = []
assert_output_files = []
target_platform = None
@@ -157,7 +165,7 @@ are exported to translation interchange files (e.g. XMB files), etc.
depend_on_stamp = False
js_minifier = None
replace_ellipsis = True
- (own_opts, args) = getopt.getopt(args, 'a:o:D:E:f:w:t:h:',
+ (own_opts, args) = getopt.getopt(args, 'a:p:o:D:E:f:w:t:h:',
('depdir=','depfile=','assert-file-list=',
'output-all-resource-defines',
'no-output-all-resource-defines',
@@ -192,6 +200,8 @@ are exported to translation interchange files (e.g. XMB files), etc.
output_all_resource_defines = False
elif key == '--no-replace-ellipsis':
replace_ellipsis = False
+ elif key == '-p':
+ predetermined_ids_file = val
elif key == '-t':
target_platform = val
elif key == '-h':
@@ -233,6 +243,7 @@ are exported to translation interchange files (e.g. XMB files), etc.
self.res = grd_reader.Parse(opts.input,
debug=opts.extra_verbose,
first_ids_file=first_ids_file,
+ predetermined_ids_file=predetermined_ids_file,
defines=self.defines,
target_platform=target_platform)

Powered by Google App Engine
This is Rietveld 408576698