From 4be8f31c6f2f69d1c04a0ff93612ff533ab2ad26 Mon Sep 17 00:00:00 2001 From: "joi@chromium.org" Date: Thu, 22 Sep 2011 15:12:51 +0000 Subject: Prepare for moving grit to its own open-source project. This involved: - Removing a grit->Chrome dependency that had been added in a unit test; - Moving the very project-specific resource_ids file to not sit in the same directory as the grit files (albeit in a hacky way; will fix this better later as per TODOs in code); and - Removing the hard-coding of "project base dir is two directories up from grit.py" and instead making that a parameter of resource_ids (as per TODO in code, this should later move to be a parameter of the .grd file). Also fixed a minor bug in relpath in misc.py, and fixed line length in grd_runner.py. The next steps will be to copy the tools/grit folder into http://code.google.com/p/grit-i18n, then in a single commit delete tools/grit from the Chrome repo and add it back in via DEPS. Follow-up fixes will address some of the TODOs, and later fixes will generalize a few things and add some features available in a different version of grit. BUG=97420 TEST=trybots should catch any breakage here Review URL: http://codereview.chromium.org/7976026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102276 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/grit/grit.py | 4 +- tools/grit/grit/grd_reader_unittest.py | 10 +- tools/grit/grit/grit_runner.py | 14 +- tools/grit/grit/node/misc.py | 47 +++-- tools/grit/grit/node/misc_unittest.py | 9 +- .../testdata/chrome/app/generated_resources.grd | 199 +++++++++++++++++++++ tools/grit/grit/testdata/resource_ids | 1 + tools/grit/grit/testdata/tools/grit/resource_ids | 175 ++++++++++++++++++ tools/grit/grit_info.py | 13 +- tools/grit/resource_ids | 170 ------------------ tools/gritsettings/resource_ids | 175 ++++++++++++++++++ 11 files changed, 615 insertions(+), 202 deletions(-) mode change 100644 => 100755 tools/grit/grit.py create mode 100644 tools/grit/grit/testdata/chrome/app/generated_resources.grd create mode 100644 tools/grit/grit/testdata/tools/grit/resource_ids delete mode 100644 tools/grit/resource_ids create mode 100644 tools/gritsettings/resource_ids (limited to 'tools') diff --git a/tools/grit/grit.py b/tools/grit/grit.py old mode 100644 new mode 100755 index b9c1ad8..772d8c2 --- a/tools/grit/grit.py +++ b/tools/grit/grit.py @@ -1,5 +1,5 @@ -#!/usr/bin/python2.4 -# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +#!/usr/bin/python +# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/tools/grit/grit/grd_reader_unittest.py b/tools/grit/grit/grd_reader_unittest.py index 1670e4a..050f877c 100644 --- a/tools/grit/grit/grd_reader_unittest.py +++ b/tools/grit/grit/grd_reader_unittest.py @@ -114,8 +114,10 @@ class GrdReaderUnittest(unittest.TestCase): grit_root_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') root.AssignFirstIds( - os.path.join(grit_root_dir, "../../chrome/app/generated_resources.grd"), - None, {}) + os.path.join(grit_root_dir, + "grit/testdata/chrome/app/generated_resources.grd"), + os.path.join(grit_root_dir, "grit/testdata/tools/grit/resource_ids"), + {}) messages_node = root.children[0].children[0] self.failUnless(isinstance(messages_node, empty.MessagesNode)) self.failUnless(messages_node.attrs["first_id"] != @@ -144,7 +146,9 @@ class GrdReaderUnittest(unittest.TestCase): grit_root_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') root.AssignFirstIds( - os.path.join(grit_root_dir, "../../test.grd"), + # This file does not actually exist, but the path must match + # the path of the resource_ids file as it has SRCDIR set to "." + os.path.join(grit_root_dir, "grit/testdata/test.grd"), os.path.join(grit_root_dir, "grit/testdata/resource_ids"), {}) messages_node = root.children[0].children[0] diff --git a/tools/grit/grit/grit_runner.py b/tools/grit/grit/grit_runner.py index 2af7299..b42bfce 100644 --- a/tools/grit/grit/grit_runner.py +++ b/tools/grit/grit/grit_runner.py @@ -1,5 +1,5 @@ #!/usr/bin/python2.4 -# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -52,12 +52,16 @@ _TOOLS = [ _REQUIRES_INPUT : False }], ['sdiff', { _CLASS : grit.tool.diff_structures.DiffStructures, _REQUIRES_INPUT : False }], - ['resize', { _CLASS : grit.tool.resize.ResizeDialog, _REQUIRES_INPUT : True }], + ['resize', { + _CLASS : grit.tool.resize.ResizeDialog, _REQUIRES_INPUT : True }], ['unit', { _CLASS : grit.tool.unit.UnitTestTool, _REQUIRES_INPUT : False }], ['count', { _CLASS : grit.tool.count.CountMessage, _REQUIRES_INPUT : True }], - ['test', { _CLASS: grit.tool.test.TestTool, _REQUIRES_INPUT : True, _HIDDEN : True }], - ['menufromparts', { _CLASS: grit.tool.menu_from_parts.MenuTranslationsFromParts, - _REQUIRES_INPUT : True, _HIDDEN : True }], + ['test', { + _CLASS: grit.tool.test.TestTool, _REQUIRES_INPUT : True, + _HIDDEN : True }], + ['menufromparts', { + _CLASS: grit.tool.menu_from_parts.MenuTranslationsFromParts, + _REQUIRES_INPUT : True, _HIDDEN : True }], ] diff --git a/tools/grit/grit/node/misc.py b/tools/grit/grit/node/misc.py index e077b03..46eae17 100644 --- a/tools/grit/grit/node/misc.py +++ b/tools/grit/grit/node/misc.py @@ -1,5 +1,5 @@ #!/usr/bin/python2.4 -# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -20,15 +20,25 @@ from grit import util import grit.format.rc_header -def _ReadFirstIdsFromFile(filename, defines, src_root_dir): +def _ReadFirstIdsFromFile(filename, defines): '''Read the starting resource id values from |filename|. We also expand variables of the form <(FOO) based on defines passed in on - the command line.''' + the command line. + + Returns a tuple, the absolute path of SRCDIR followed by the + first_ids dictionary. + ''' first_ids_dict = eval(open(filename).read()) + # TODO(joi@chromium.org): It might make sense to make this a + # parameter of the .grd file rather than of the resource_ids file. + src_root_dir = os.path.abspath(os.path.join(os.path.dirname(filename), + first_ids_dict['SRCDIR'])) + def ReplaceVariable(matchobj): for key, value in defines.iteritems(): if matchobj.group(1) == key: + value = os.path.join(src_root_dir, value) value = os.path.abspath(value)[len(src_root_dir) + 1:] return value return '' @@ -45,7 +55,7 @@ def _ReadFirstIdsFromFile(filename, defines, src_root_dir): first_ids_dict[new_grd_filename] = first_ids_dict[grd_filename] del(first_ids_dict[grd_filename]) - return first_ids_dict + return (src_root_dir, first_ids_dict) class IfNode(base.Node): @@ -303,27 +313,34 @@ class GritNode(base.Node): if type(filename_or_stream) not in (str, unicode): return - # By default, we use the the file resources_ids next to grit.py - # to determine what ids to assign to resources. - grit_root_dir = os.path.abspath(os.path.join(os.path.dirname( - os.path.abspath(__file__)), '..', '..')) + # TODO(joi@chromium.org): Get rid of this hack by making it + # possible to specify the resource_ids file to use as an attribute + # of the node in the .grd file, and doing so in all Chrome + # .grd files. + # + # For now, by default, we use the the file + # ../gritsettings/resource_ids relative to grit.py. if not first_id_filename: - first_id_filename = os.path.join(grit_root_dir, 'resource_ids') + first_id_filename = os.path.join( + os.path.dirname(__file__), + '..', '..', '..', + 'gritsettings', 'resource_ids') first_ids = None from grit.node import empty for node in self.inorder(): if isinstance(node, empty.GroupingNode): - # The checkout base directory is 2 directories up from grit.py. - src_root_dir = os.path.dirname(os.path.dirname(grit_root_dir)) - + if not first_ids: + src_root_dir, first_ids = _ReadFirstIdsFromFile(first_id_filename, + defines) filename = os.path.abspath(filename_or_stream)[ len(src_root_dir) + 1:] filename = filename.replace('\\', '/') - if not first_ids: - first_ids = _ReadFirstIdsFromFile(first_id_filename, defines, - src_root_dir) + # TODO(joi@chromium.org): Generalize this; users other than + # Chrome might want to use the first_id attribute; could check + # for first_ids == None to indicate not loaded, first_ids == + # {} to indicate tried to load but found no resource_ids file. if node.attrs['first_id'] != '': raise Exception("Don't set the first_id attribute, update " "%s instead." % first_id_filename) diff --git a/tools/grit/grit/node/misc_unittest.py b/tools/grit/grit/node/misc_unittest.py index 11f7b8f..6e89465 100644 --- a/tools/grit/grit/node/misc_unittest.py +++ b/tools/grit/grit/node/misc_unittest.py @@ -32,13 +32,12 @@ class GritNodeUnittest(unittest.TestCase): def testReadFirstIdsFromFile(self): test_resource_ids = os.path.join(os.path.dirname(__file__), '..', 'testdata', 'resource_ids') - id_dict = misc._ReadFirstIdsFromFile( + src_dir, id_dict = misc._ReadFirstIdsFromFile( test_resource_ids, { - 'FOO': '/bar', - 'SHARED_INTERMEDIATE_DIR': '/out/Release/obj/gen', - }, - '') + 'FOO': 'bar', + 'SHARED_INTERMEDIATE_DIR': 'out/Release/obj/gen', + }) self.assertEqual({}, id_dict.get('bar/file.grd', None)) self.assertEqual({}, id_dict.get('out/Release/obj/gen/devtools/devtools.grd', None)) diff --git a/tools/grit/grit/testdata/chrome/app/generated_resources.grd b/tools/grit/grit/testdata/chrome/app/generated_resources.grd new file mode 100644 index 0000000..c2efb77 --- /dev/null +++ b/tools/grit/grit/testdata/chrome/app/generated_resources.grd @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New background app installed + + + $1Background App will launch at system startup and continue to run in the background even once you've closed all other $2Google Chrome windows. + + + + + + + + + + + diff --git a/tools/grit/grit/testdata/resource_ids b/tools/grit/grit/testdata/resource_ids index b43d78d..b230695 100644 --- a/tools/grit/grit/testdata/resource_ids +++ b/tools/grit/grit/testdata/resource_ids @@ -1,4 +1,5 @@ { + "SRCDIR": ".", "test.grd": { "messages": [100, 10000], }, diff --git a/tools/grit/grit/testdata/tools/grit/resource_ids b/tools/grit/grit/testdata/tools/grit/resource_ids new file mode 100644 index 0000000..d8f71ff --- /dev/null +++ b/tools/grit/grit/testdata/tools/grit/resource_ids @@ -0,0 +1,175 @@ +# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# This file is used to assign starting resource ids for resources and strings +# used by Chromium. This is done to ensure that resource ids are unique +# across all the grd files. If you are adding a new grd file, please add +# a new entry to this file. +# +# The first entry in the file, SRCDIR, is special: It is a relative path from +# this file to the base of your checkout. +# +# http://msdn.microsoft.com/en-us/library/t2zechd4(VS.71).aspx says that the +# range for IDR_ is 1 to 28,671 and the range for IDS_ is 1 to 32,767 and +# common convention starts practical use of IDs at 100 or 101. +{ + "SRCDIR": "../..", + + "chrome/browser/browser_resources.grd": { + "includes": [500], + }, + "chrome/browser/resources/component_extension_resources.grd": { + "includes": [1000], + }, + "chrome/browser/resources/net_internals_resources.grd": { + "includes": [1500], + }, + "chrome/browser/resources/shared_resources.grd": { + "includes": [2000], + }, + "chrome/common/common_resources.grd": { + "includes": [2500], + }, + "chrome/default_plugin/default_plugin_resources.grd": { + "includes": [3000], + }, + "chrome/renderer/renderer_resources.grd": { + "includes": [3500], + }, + "net/base/net_resources.grd": { + "includes": [4000], + }, + "webkit/glue/webkit_resources.grd": { + "includes": [4500], + }, + "webkit/tools/test_shell/test_shell_resources.grd": { + "includes": [5000], + }, + "ui/resources/ui_resources.grd": { + "includes": [5500], + }, + "chrome/app/theme/theme_resources.grd": { + "includes": [6000], + }, + "chrome_frame/resources/chrome_frame_resources.grd": { + "includes": [6500], + }, + # WebKit.grd can be in two different places depending on whether we are + # in a chromium checkout or a webkit-only checkout. + "third_party/WebKit/Source/WebKit/chromium/WebKit.grd": { + "includes": [7000], + }, + "WebKit.grd": { + "includes": [7000], + }, + + "ui/base/strings/app_locale_settings.grd": { + "messages": [7500], + }, + "chrome/app/resources/locale_settings.grd": { + "includes": [8000], + "messages": [8500], + }, + # These each start with the same resource id because we only use one + # file for each build (cros, linux, mac, or win). + "chrome/app/resources/locale_settings_cros.grd": { + "messages": [9000], + }, + "chrome/app/resources/locale_settings_linux.grd": { + "messages": [9000], + }, + "chrome/app/resources/locale_settings_mac.grd": { + "messages": [9000], + }, + "chrome/app/resources/locale_settings_win.grd": { + "messages": [9000], + }, + + "ui/base/strings/ui_strings.grd": { + "messages": [9500], + }, + # Chromium strings and Google Chrome strings must start at the same id. + # We only use one file depending on whether we're building Chromium or + # Google Chrome. + "chrome/app/chromium_strings.grd": { + "messages": [10000], + }, + "chrome/app/google_chrome_strings.grd": { + "messages": [10000], + }, + # Leave lots of space for generated_resources since it has most of our + # strings. + "chrome/app/generated_resources.grd": { + "structures": [10500], + "messages": [11000], + }, + # The chrome frame dialogs are also in generated_resources.grd so they + # get included by the translation console. We make sure that the ids + # for structures here are the same as for generated_resources.grd. + "chrome_frame/resources/chrome_frame_dialogs.grd": { + "structures": [10500], + "includes": [10750], + }, + "webkit/glue/inspector_strings.grd": { + "messages": [16000], + }, + "webkit/glue/webkit_strings.grd": { + "messages": [16500], + }, + + "chrome_frame/resources/chrome_frame_resources.grd": { + "includes": [17500], + "structures": [18000], + }, + + "ui/gfx/gfx_resources.grd": { + "includes": [18500], + }, + + "chrome/app/policy/policy_templates.grd": { + "structures": [19000], + "messages": [19010], + }, + + "chrome/browser/autofill/autofill_resources.grd": { + "messages": [19500], + }, + "chrome/browser/resources/sync_internals_resources.grd": { + "includes": [20000], + }, + # This file is generated during the build. + "<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd": { + "includes": [20500], + }, + # All standard and large theme resources should have the same IDs. + "chrome/app/theme/theme_resources_standard.grd": { + "includes": [21000], + }, + "chrome/app/theme/theme_resources_large.grd": { + "includes": [21000], + }, + # This file is generated during the build. + "chrome/browser/debugger/frontend/devtools_frontend_resources.grd": { + "includes": [21500], + }, + "chrome/browser/resources/options_resources.grd": { + "includes": [22000], + }, + "cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd": { + "messages": [22500], + }, + "chrome/browser/resources/quota_internals_resources.grd": { + "includes": [23000], + }, + "chrome/browser/resources/workers_resources.grd": { + "includes": [23500], + }, + # All standard and large theme resources should have the same IDs. + "ui/resources/ui_resources_standard.grd": { + "includes": [24000], + }, + "ui/resources/ui_resources_large.grd": { + "includes": [24000], + }, +} diff --git a/tools/grit/grit_info.py b/tools/grit/grit_info.py index 9723aad..e1e6a66 100755 --- a/tools/grit/grit_info.py +++ b/tools/grit/grit_info.py @@ -11,6 +11,7 @@ import os import posixpath import types import sys + from grit import grd_reader from grit import util @@ -93,7 +94,7 @@ def relpath(path, start=os.path.curdir): rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:] if not rel_list: - return curdir + return os.path.curdir return os.path.join(*rel_list) ############################################################################## @@ -139,8 +140,16 @@ def GritSourceFiles(): grit_root_dir = relpath(os.path.dirname(__file__), os.getcwd()) for root, dirs, filenames in os.walk(grit_root_dir): grit_src = [os.path.join(root, f) for f in filenames - if f.endswith('.py') or f == 'resource_ids'] + 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 = 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 diff --git a/tools/grit/resource_ids b/tools/grit/resource_ids deleted file mode 100644 index b8d09ec..0000000 --- a/tools/grit/resource_ids +++ /dev/null @@ -1,170 +0,0 @@ -# Copyright (c) 2011 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -# -# This file is used to assign starting resource ids for resources and strings -# used by Chromium. This is done to ensure that resource ids are unique -# across all the grd files. If you are adding a new grd file, please add -# a new entry to this file. -# -# http://msdn.microsoft.com/en-us/library/t2zechd4(VS.71).aspx says that the -# range for IDR_ is 1 to 28,671 and the range for IDS_ is 1 to 32,767 and -# common convention starts practical use of IDs at 100 or 101. -{ - "chrome/browser/browser_resources.grd": { - "includes": [500], - }, - "chrome/browser/resources/component_extension_resources.grd": { - "includes": [1000], - }, - "chrome/browser/resources/net_internals_resources.grd": { - "includes": [1500], - }, - "chrome/browser/resources/shared_resources.grd": { - "includes": [2000], - }, - "chrome/common/common_resources.grd": { - "includes": [2500], - }, - "chrome/default_plugin/default_plugin_resources.grd": { - "includes": [3000], - }, - "chrome/renderer/renderer_resources.grd": { - "includes": [3500], - }, - "net/base/net_resources.grd": { - "includes": [4000], - }, - "webkit/glue/webkit_resources.grd": { - "includes": [4500], - }, - "webkit/tools/test_shell/test_shell_resources.grd": { - "includes": [5000], - }, - "ui/resources/ui_resources.grd": { - "includes": [5500], - }, - "chrome/app/theme/theme_resources.grd": { - "includes": [6000], - }, - "chrome_frame/resources/chrome_frame_resources.grd": { - "includes": [6500], - }, - # WebKit.grd can be in two different places depending on whether we are - # in a chromium checkout or a webkit-only checkout. - "third_party/WebKit/Source/WebKit/chromium/WebKit.grd": { - "includes": [7000], - }, - "WebKit.grd": { - "includes": [7000], - }, - - "ui/base/strings/app_locale_settings.grd": { - "messages": [7500], - }, - "chrome/app/resources/locale_settings.grd": { - "includes": [8000], - "messages": [8500], - }, - # These each start with the same resource id because we only use one - # file for each build (cros, linux, mac, or win). - "chrome/app/resources/locale_settings_cros.grd": { - "messages": [9000], - }, - "chrome/app/resources/locale_settings_linux.grd": { - "messages": [9000], - }, - "chrome/app/resources/locale_settings_mac.grd": { - "messages": [9000], - }, - "chrome/app/resources/locale_settings_win.grd": { - "messages": [9000], - }, - - "ui/base/strings/ui_strings.grd": { - "messages": [9500], - }, - # Chromium strings and Google Chrome strings must start at the same id. - # We only use one file depending on whether we're building Chromium or - # Google Chrome. - "chrome/app/chromium_strings.grd": { - "messages": [10000], - }, - "chrome/app/google_chrome_strings.grd": { - "messages": [10000], - }, - # Leave lots of space for generated_resources since it has most of our - # strings. - "chrome/app/generated_resources.grd": { - "structures": [10500], - "messages": [11000], - }, - # The chrome frame dialogs are also in generated_resources.grd so they - # get included by the translation console. We make sure that the ids - # for structures here are the same as for generated_resources.grd. - "chrome_frame/resources/chrome_frame_dialogs.grd": { - "structures": [10500], - "includes": [10750], - }, - "webkit/glue/inspector_strings.grd": { - "messages": [16000], - }, - "webkit/glue/webkit_strings.grd": { - "messages": [16500], - }, - - "chrome_frame/resources/chrome_frame_resources.grd": { - "includes": [17500], - "structures": [18000], - }, - - "ui/gfx/gfx_resources.grd": { - "includes": [18500], - }, - - "chrome/app/policy/policy_templates.grd": { - "structures": [19000], - "messages": [19010], - }, - - "chrome/browser/autofill/autofill_resources.grd": { - "messages": [19500], - }, - "chrome/browser/resources/sync_internals_resources.grd": { - "includes": [20000], - }, - # This file is generated during the build. - "<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd": { - "includes": [20500], - }, - # All standard and large theme resources should have the same IDs. - "chrome/app/theme/theme_resources_standard.grd": { - "includes": [21000], - }, - "chrome/app/theme/theme_resources_large.grd": { - "includes": [21000], - }, - # This file is generated during the build. - "chrome/browser/debugger/frontend/devtools_frontend_resources.grd": { - "includes": [21500], - }, - "chrome/browser/resources/options_resources.grd": { - "includes": [22000], - }, - "cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd": { - "messages": [22500], - }, - "chrome/browser/resources/quota_internals_resources.grd": { - "includes": [23000], - }, - "chrome/browser/resources/workers_resources.grd": { - "includes": [23500], - }, - # All standard and large theme resources should have the same IDs. - "ui/resources/ui_resources_standard.grd": { - "includes": [24000], - }, - "ui/resources/ui_resources_large.grd": { - "includes": [24000], - }, -} diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids new file mode 100644 index 0000000..d8f71ff --- /dev/null +++ b/tools/gritsettings/resource_ids @@ -0,0 +1,175 @@ +# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# This file is used to assign starting resource ids for resources and strings +# used by Chromium. This is done to ensure that resource ids are unique +# across all the grd files. If you are adding a new grd file, please add +# a new entry to this file. +# +# The first entry in the file, SRCDIR, is special: It is a relative path from +# this file to the base of your checkout. +# +# http://msdn.microsoft.com/en-us/library/t2zechd4(VS.71).aspx says that the +# range for IDR_ is 1 to 28,671 and the range for IDS_ is 1 to 32,767 and +# common convention starts practical use of IDs at 100 or 101. +{ + "SRCDIR": "../..", + + "chrome/browser/browser_resources.grd": { + "includes": [500], + }, + "chrome/browser/resources/component_extension_resources.grd": { + "includes": [1000], + }, + "chrome/browser/resources/net_internals_resources.grd": { + "includes": [1500], + }, + "chrome/browser/resources/shared_resources.grd": { + "includes": [2000], + }, + "chrome/common/common_resources.grd": { + "includes": [2500], + }, + "chrome/default_plugin/default_plugin_resources.grd": { + "includes": [3000], + }, + "chrome/renderer/renderer_resources.grd": { + "includes": [3500], + }, + "net/base/net_resources.grd": { + "includes": [4000], + }, + "webkit/glue/webkit_resources.grd": { + "includes": [4500], + }, + "webkit/tools/test_shell/test_shell_resources.grd": { + "includes": [5000], + }, + "ui/resources/ui_resources.grd": { + "includes": [5500], + }, + "chrome/app/theme/theme_resources.grd": { + "includes": [6000], + }, + "chrome_frame/resources/chrome_frame_resources.grd": { + "includes": [6500], + }, + # WebKit.grd can be in two different places depending on whether we are + # in a chromium checkout or a webkit-only checkout. + "third_party/WebKit/Source/WebKit/chromium/WebKit.grd": { + "includes": [7000], + }, + "WebKit.grd": { + "includes": [7000], + }, + + "ui/base/strings/app_locale_settings.grd": { + "messages": [7500], + }, + "chrome/app/resources/locale_settings.grd": { + "includes": [8000], + "messages": [8500], + }, + # These each start with the same resource id because we only use one + # file for each build (cros, linux, mac, or win). + "chrome/app/resources/locale_settings_cros.grd": { + "messages": [9000], + }, + "chrome/app/resources/locale_settings_linux.grd": { + "messages": [9000], + }, + "chrome/app/resources/locale_settings_mac.grd": { + "messages": [9000], + }, + "chrome/app/resources/locale_settings_win.grd": { + "messages": [9000], + }, + + "ui/base/strings/ui_strings.grd": { + "messages": [9500], + }, + # Chromium strings and Google Chrome strings must start at the same id. + # We only use one file depending on whether we're building Chromium or + # Google Chrome. + "chrome/app/chromium_strings.grd": { + "messages": [10000], + }, + "chrome/app/google_chrome_strings.grd": { + "messages": [10000], + }, + # Leave lots of space for generated_resources since it has most of our + # strings. + "chrome/app/generated_resources.grd": { + "structures": [10500], + "messages": [11000], + }, + # The chrome frame dialogs are also in generated_resources.grd so they + # get included by the translation console. We make sure that the ids + # for structures here are the same as for generated_resources.grd. + "chrome_frame/resources/chrome_frame_dialogs.grd": { + "structures": [10500], + "includes": [10750], + }, + "webkit/glue/inspector_strings.grd": { + "messages": [16000], + }, + "webkit/glue/webkit_strings.grd": { + "messages": [16500], + }, + + "chrome_frame/resources/chrome_frame_resources.grd": { + "includes": [17500], + "structures": [18000], + }, + + "ui/gfx/gfx_resources.grd": { + "includes": [18500], + }, + + "chrome/app/policy/policy_templates.grd": { + "structures": [19000], + "messages": [19010], + }, + + "chrome/browser/autofill/autofill_resources.grd": { + "messages": [19500], + }, + "chrome/browser/resources/sync_internals_resources.grd": { + "includes": [20000], + }, + # This file is generated during the build. + "<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd": { + "includes": [20500], + }, + # All standard and large theme resources should have the same IDs. + "chrome/app/theme/theme_resources_standard.grd": { + "includes": [21000], + }, + "chrome/app/theme/theme_resources_large.grd": { + "includes": [21000], + }, + # This file is generated during the build. + "chrome/browser/debugger/frontend/devtools_frontend_resources.grd": { + "includes": [21500], + }, + "chrome/browser/resources/options_resources.grd": { + "includes": [22000], + }, + "cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd": { + "messages": [22500], + }, + "chrome/browser/resources/quota_internals_resources.grd": { + "includes": [23000], + }, + "chrome/browser/resources/workers_resources.grd": { + "includes": [23500], + }, + # All standard and large theme resources should have the same IDs. + "ui/resources/ui_resources_standard.grd": { + "includes": [24000], + }, + "ui/resources/ui_resources_large.grd": { + "includes": [24000], + }, +} -- cgit v1.1