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

Unified Diff: grit_info.py

Issue 9802029: Make first_ids_file an optional attribute of the .grd file. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 9 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
« grit/tool/build.py ('K') | « grit/tool/build.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit_info.py
===================================================================
--- grit_info.py (revision 18)
+++ grit_info.py (working copy)
@@ -20,8 +20,15 @@
def Outputs(filename, defines):
+ # TODO(joi@chromium.org): The first_ids_file can now be specified
+ # via an attribute on the <grit> node. Once a change lands in
+ # WebKit to use this attribute, we can stop specifying the
+ # first_ids_file parameter here and instead specify it in all grd
+ # files. For now, since Chrome is the only user of grit_info.py,
+ # this is fine.
grd = grd_reader.Parse(
- filename, defines=defines, tags_to_ignore=set(['messages']))
+ filename, defines=defines, tags_to_ignore=set(['messages']),
+ first_ids_file='GRIT_DIR/../gritsettings/resource_ids')
target = []
lang_folders = {}
@@ -58,26 +65,29 @@
grit_src = [os.path.join(root, f) for f in filenames
if f.endswith('.py')]
files.extend(grit_src)
- # TODO(joi@chromium.org): Once we switch to specifying the
- # resource_ids file via a .grd attribute, it should be considered an
- # input of grit and this bit should no longer be necessary.
- default_resource_ids = os.path.relpath(
- os.path.join(grit_root_dir, '..', 'gritsettings', 'resource_ids'),
- os.getcwd())
- if os.path.exists(default_resource_ids):
- files.append(default_resource_ids)
return files
def Inputs(filename, defines):
+ # TODO(joi@chromium.org): The first_ids_file can now be specified
+ # via an attribute on the <grit> node. Once a change lands in
+ # WebKit to use this attribute, we can stop specifying the
+ # first_ids_file parameter here and instead specify it in all grd
+ # files. For now, since Chrome is the only user of grit_info.py,
+ # this is fine.
grd = grd_reader.Parse(
- filename, debug=False, defines=defines, tags_to_ignore=set(['messages']))
+ filename, debug=False, defines=defines, tags_to_ignore=set(['messages']),
+ first_ids_file='GRIT_DIR/../gritsettings/resource_ids')
files = []
for node in grd:
if (node.name == 'structure' or node.name == 'skeleton' or
(node.name == 'file' and node.parent and
node.parent.name == 'translations')):
files.append(node.GetFilePath())
+ elif node.name == 'grit':
+ first_ids_file = node.GetFirstIdsFile()
+ if first_ids_file:
+ files.append(first_ids_file)
elif node.name == 'include':
# Only include files that we actually plan on using.
if node.SatisfiesOutputCondition():
« grit/tool/build.py ('K') | « grit/tool/build.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698