Commit 12af5221 authored by thestig's avatar thestig Committed by Commit bot

grit: Reorganize and compact resource_ids.

BUG=585301

Review-Url: https://codereview.chromium.org/2429213007
Cr-Commit-Position: refs/heads/master@{#427236}
parent abfc7f7c
...@@ -12,6 +12,7 @@ import re ...@@ -12,6 +12,7 @@ import re
from functools import partial from functools import partial
from grit import util from grit import util
from grit.format import rc_header
from grit.node import misc from grit.node import misc
...@@ -448,8 +449,10 @@ def FormatInclude(item, lang, output_dir, type=None, process_html=False): ...@@ -448,8 +449,10 @@ def FormatInclude(item, lang, output_dir, type=None, process_html=False):
if isinstance(item, structure.StructureNode) and item.IsExcludedFromRc(): if isinstance(item, structure.StructureNode) and item.IsExcludedFromRc():
return '' return ''
else:
return '%-18s %-18s "%s"\n' % (item.attrs['name'], type, filename) name = item.attrs['name']
item_id = rc_header.GetIds(item.GetRoot())[name]
return '// ID: %d\n%-18s %-18s "%s"\n' % (item_id, name, type, filename)
def _DoNotFormat(item, lang, output_dir): def _DoNotFormat(item, lang, output_dir):
......
...@@ -7,294 +7,353 @@ ...@@ -7,294 +7,353 @@
# across all the grd files. If you are adding a new grd file, please add # across all the grd files. If you are adding a new grd file, please add
# a new entry to this file. # a new entry to this file.
# #
# The first entry in the file, SRCDIR, is special: It is a relative path from # The entries below are organized into sections. When adding new entries,
# this file to the base of your checkout. # please use the right section. Try to keep entries in alphabetical order.
#
# - chrome/app/
# - chrome/browser/
# - chrome/ miscellaneous
# - components/
# - content/
# - ios/ (overlaps with chrome/ and content/)
# - everything else
# #
# The range of ID values, which is used by pak files, is from 0 to 2^16 - 1. # The range of ID values, which is used by pak files, is from 0 to 2^16 - 1.
{ {
# The first entry in the file, SRCDIR, is special: It is a relative path from
# this file to the base of your checkout.
"SRCDIR": "../..", "SRCDIR": "../..",
"chrome/browser/browser_resources.grd": { # START chrome/app section.
"includes": [400], # Previous versions of this file started with resource id 400, so stick with
"structures": [850], # that.
#
# chrome/ and ios/chrome/ must start at the same id.
# App only use one file depending on whether it is iOS or other platform.
"chrome/app/address_input_strings.grd": {
"messages": [400],
}, },
"chrome/browser/resources/component_extension_resources.grd": {
"includes": [1000], # Chromium strings and Google Chrome strings must start at the same id.
"structures": [1450], # We only use one file depending on whether we're building Chromium or
# Google Chrome.
"chrome/app/chromium_strings.grd": {
"messages": [500],
}, },
"chrome/browser/resources/net_internals_resources.grd": { "chrome/app/google_chrome_strings.grd": {
"includes": [1500], "messages": [500],
}, },
"ui/webui/resources/webui_resources.grd": {
"includes": [2000], # Leave lots of space for generated_resources since it has most of our
"structures": [2200], # strings.
"chrome/app/generated_resources.grd": {
"messages": [900],
}, },
"chrome/common/common_resources.grd": {
"includes": [3000], "chrome/app/resources/locale_settings.grd": {
"messages": [10000],
}, },
"chrome/renderer/resources/renderer_resources.grd": {
"includes": [3500], # These each start with the same resource id because we only use one
"structures": [3700], # file for each build (chromiumos, google_chromeos, linux, mac, or win).
"chrome/app/resources/locale_settings_chromiumos.grd": {
"messages": [10100],
}, },
"net/base/net_resources.grd": { "chrome/app/resources/locale_settings_google_chromeos.grd": {
"includes": [4000], "messages": [10100],
}, },
"ui/resources/ui_unscaled_resources.grd": { "chrome/app/resources/locale_settings_linux.grd": {
"includes": [4500], "messages": [10100],
}, },
"content/app/resources/content_resources.grd": { "chrome/app/resources/locale_settings_mac.grd": {
"structures": [4700], "messages": [10100],
}, },
"third_party/WebKit/public/blink_image_resources.grd": { "chrome/app/resources/locale_settings_win.grd": {
"structures": [4750], "messages": [10100],
}, },
"ui/resources/ui_resources.grd": {
"structures": [5500], "chrome/app/theme/chrome_unscaled_resources.grd": {
"includes": [10150],
}, },
"ui/app_list/resources/app_list_resources.grd": {
"structures": [5760], # Leave space for theme_resources since it has many structures.
"chrome/app/theme/theme_resources.grd": {
"structures": [10200],
}, },
"ui/views/resources/views_resources.grd": { # END chrome/app section.
"structures": [5800],
# START chrome/browser section.
"chrome/browser/browser_resources.grd": {
"includes": [11000],
"structures": [11450],
}, },
"ash/resources/ash_resources.grd": { "chrome/browser/resources/component_extension_resources.grd": {
"includes": [6100], "includes": [11550],
"structures": [6150], "structures": [11800],
}, },
"ui/keyboard/keyboard_resources.grd": { "chrome/browser/resources/invalidations_resources.grd": {
"includes": [6850], "includes": [11850],
}, },
"chrome/app/theme/theme_resources.grd": { "chrome/browser/resources/md_policy/policy_resources.grd": {
"structures": [7000], "structures": [11860],
}, },
"chrome/app/theme/chrome_unscaled_resources.grd": { "chrome/browser/resources/net_internals_resources.grd": {
"includes": [8000], "includes": [11900],
}, },
"ui/strings/app_locale_settings.grd": { "chrome/browser/resources/options_resources.grd": {
"messages": [9000], "includes": [11910],
"structures": [11920],
}, },
"chrome/app/resources/locale_settings.grd": { "chrome/browser/resources/options_test_resources.grd": {
"messages": [9500], "structures": [11950],
}, },
# These each start with the same resource id because we only use one "chrome/browser/resources/password_manager_internals_resources.grd": {
# file for each build (chromiumos, google_chromeos, linux, mac, or win). "includes": [11960],
"chrome/app/resources/locale_settings_chromiumos.grd": {
"messages": [10500],
}, },
"chrome/app/resources/locale_settings_google_chromeos.grd": { "chrome/browser/resources/quota_internals_resources.grd": {
"messages": [10500], "includes": [11970],
}, },
"chrome/app/resources/locale_settings_linux.grd": { "chrome/browser/resources/settings/settings_resources.grd": {
"messages": [10500], "structures": [12000],
}, },
"chrome/app/resources/locale_settings_mac.grd": { "chrome/browser/resources/sync_file_system_internals_resources.grd": {
"messages": [10500], "includes": [12500],
}, },
"chrome/app/resources/locale_settings_win.grd": { "chrome/browser/resources/task_scheduler_internals/resources.grd": {
"messages": [10500], "includes": [12530],
}, },
"ui/strings/ui_strings.grd": { "chrome/browser/resources/translate_internals_resources.grd": {
"messages": [11000], "includes": [12540],
},
# END chrome/browser section.
# START chrome/ miscellaneous section.
"chrome/common/common_resources.grd": {
"includes": [12700],
}, },
"chrome/renderer/resources/renderer_resources.grd": {
"includes": [12710],
"structures": [12790],
},
"chrome/test/data/webui_test_resources.grd": {
"includes": [12800],
},
# END chrome/ miscellaneous section.
# START components/ section.
#
# Chromium strings and Google Chrome strings must start at the same id. # 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 # We only use one file depending on whether we're building Chromium or
# Google Chrome. # Google Chrome.
"chrome/app/chromium_strings.grd": { "components/components_chromium_strings.grd": {
"messages": [11200], "messages": [15000],
},
"chrome/app/google_chrome_strings.grd": {
"messages": [11200],
},
# Leave lots of space for generated_resources since it has most of our
# strings.
"chrome/app/generated_resources.grd": {
"structures": [11700],
"messages": [12200],
}, },
"content/app/strings/content_strings.grd": { "components/components_google_chrome_strings.grd": {
"messages": [19400], "messages": [15000],
}, },
"components/policy/resources/policy_templates.grd": {
"structures": [20100], "components/components_locale_settings.grd": {
"messages": [20110], "includes": [15020],
"messages": [15030],
}, },
"chrome/browser/resources/invalidations_resources.grd": { "components/components_strings.grd": {
"includes": [21100], "messages": [15040],
}, },
# This file is generated during the build. "components/chrome_apps/chrome_apps_resources.grd": {
"<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd": { "includes": [15900],
"includes": [21150],
}, },
"devtools_resources.grd": { "components/policy/resources/policy_templates.grd": {
"includes": [21150], "structures": [15920],
}, },
"chrome/browser/resources/options_resources.grd": { "components/resources/components_resources.grd": {
"includes": [22150], "includes": [15930],
"structures": [22350],
}, },
"chrome/browser/resources/options_test_resources.grd": { "components/resources/components_scaled_resources.grd": {
"includes": [22550], "structures": [16050],
"structures": [22590],
}, },
"chrome/test/data/webui_test_resources.grd": { # END components/ section.
"includes": [22630],
"structures": [22640], # START content/ section.
# content/ and ios/web/ must start at the same id.
# App only use one file depending on whether it is iOS or other platform.
"content/app/resources/content_resources.grd": {
"structures": [20000],
}, },
"chrome/browser/resources/quota_internals_resources.grd": { "content/app/strings/content_strings.grd": {
"includes": [22950], "messages": [20100],
}, },
"content/content_resources.grd": { "content/content_resources.grd": {
"includes": [23650], "includes": [20400],
},
# ios_web strings and content strings must start at the same id.
# App only use one file depending on whether it is iOS or other platform.
"ios/web/ios_web_resources.grd": {
"includes": [23650],
},
# ios/web test strings and content/shell strings must start at the same id.
# App only use one file depending on whether it is iOS or other platform.
"ios/web/test/test_resources.grd": {
"includes": [24150],
}, },
"content/shell/shell_resources.grd": { "content/shell/shell_resources.grd": {
"includes": [24150], "includes": [20500],
}, },
# This file is generated during the build. # This file is generated during the build.
"<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.grd": { "<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.grd": {
"includes": [24300], "includes": [20550],
}, },
# iOS resources overlap with android_webview, ash, chromeos and extensions_api, # END content/ section.
# as these are not used on iOS.
"ios/chrome/app/strings/ios_strings.grd": { # START ios/ section.
"messages": [24550], #
# chrome/ and ios/chrome/ must start at the same id.
# App only use one file depending on whether it is iOS or other platform.
"ios/chrome/app/resources/ios_resources.grd": {
"includes": [400],
"structures": [1000],
}, },
# Chromium strings and Google Chrome strings must start at the same id. # 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 # We only use one file depending on whether we're building Chromium or
# Google Chrome. # Google Chrome.
"ios/chrome/app/strings/ios_chromium_strings.grd": { "ios/chrome/app/strings/ios_chromium_strings.grd": {
"messages": [25455], "messages": [1500],
}, },
"ios/chrome/app/strings/ios_google_chrome_strings.grd": { "ios/chrome/app/strings/ios_google_chrome_strings.grd": {
"messages": [25455], "messages": [1500],
}, },
"ios/chrome/app/resources/ios_resources.grd": {
"structures": [25650], "ios/chrome/app/strings/ios_strings.grd": {
"includes": [25760], "messages": [2000],
}, },
"ios/chrome/app/theme/ios_theme_resources.grd": { "ios/chrome/app/theme/ios_theme_resources.grd": {
"structures": [25570], "structures": [2500],
}, },
"ios/chrome/share_extension/strings/ios_share_extension_strings.grd": { "ios/chrome/share_extension/strings/ios_share_extension_strings.grd": {
"messages": [26025], "messages": [3000],
}, },
"ios/chrome/today_extension/strings/ios_today_extension_strings.grd": { "ios/chrome/today_extension/strings/ios_today_extension_strings.grd": {
"messages": [26035], "messages": [3010],
}, },
"ash/ash_strings.grd": {
"messages": [24550], # content/ and ios/web/ must start at the same id.
# App only use one file depending on whether it is iOS or other platform.
"ios/web/ios_web_resources.grd": {
"includes": [20000],
},
"ios/web/test/test_resources.grd": {
"includes": [22000],
}, },
# END ios/ section.
# START "everything else" section.
# Everything but chrome/, components/, content/, and ios/
"android_webview/ui/aw_resources.grd": { "android_webview/ui/aw_resources.grd": {
"includes": [24550], "includes": [23500],
}, },
"android_webview/ui/aw_strings.grd": { "android_webview/ui/aw_strings.grd": {
"messages": [24650], "messages": [23510],
}, },
"ui/chromeos/resources/ui_chromeos_resources.grd": {
"structures": [24850], "ash/ash_strings.grd": {
"messages": [23520],
}, },
"ui/chromeos/ui_chromeos_strings.grd": { "ash/resources/ash_resources.grd": {
"messages": [24950], "structures": [23920],
}, },
"extensions/extensions_resources.grd": {
"includes": [25250], "blimp/client/support/resources/blimp_strings.grd": {
"messages": [24200],
}, },
"extensions/browser/resources/extensions_browser_resources.grd": { "blimp/engine/app/blimp_browser_resources.grd": {
"structures": [25450], "includes": [24250],
}, },
"extensions/renderer/resources/extensions_renderer_resources.grd": {
"includes": [25500], "chromecast/browser/cast_browser_resources.grd": {
"structures": [25600], "includes": [24300],
}, },
"extensions/strings/extensions_strings.grd": {
"messages": [25650], "device/bluetooth/bluetooth_strings.grd": {
"messages": [24400],
}, },
"extensions/shell/app_shell_resources.grd": {
"includes": [26050], "extensions/browser/resources/extensions_browser_resources.grd": {
"structures": [24450],
}, },
"chrome/browser/resources/password_manager_internals_resources.grd": { "extensions/extensions_resources.grd": {
"includes": [26350], "includes": [24460],
}, },
"device/bluetooth/bluetooth_strings.grd": { "extensions/renderer/resources/extensions_renderer_resources.grd": {
"messages": [26650], "includes": [24470],
"structures": [24600],
}, },
"ui/file_manager/file_manager_resources.grd": { "extensions/shell/app_shell_resources.grd": {
"includes": [26760], "includes": [24610],
}, },
"components/chrome_apps/chrome_apps_resources.grd": { "extensions/strings/extensions_strings.grd": {
"includes": [26977], "messages": [24620],
}, },
"ui/login/login_resources.grd": {
"includes": [26990], "headless/lib/resources/headless_lib_resources.grd": {
"includes": [24700],
}, },
"chrome/browser/resources/translate_internals_resources.grd": {
"includes": [27000], "net/base/net_resources.grd": {
"includes": [24750],
}, },
"chrome/browser/resources/sync_file_system_internals_resources.grd": {
"includes": [27010], "remoting/resources/remoting_strings.grd": {
"messages": [24800],
}, },
"chrome/app/address_input_strings.grd": {
"messages": [27110], "third_party/WebKit/public/blink_image_resources.grd": {
"structures": [25300],
}, },
"remoting/resources/remoting_strings.grd": { "third_party/WebKit/public/blink_resources.grd": {
"messages": [27560], "includes": [25400],
}, },
"components/components_locale_settings.grd": {
"includes": [28010], "ui/app_list/resources/app_list_resources.grd": {
"messages": [28015], "structures": [25800],
}, },
"components/components_strings.grd": { "ui/chromeos/resources/ui_chromeos_resources.grd": {
"messages": [28020], "structures": [25820],
}, },
"chrome/browser/resources/task_scheduler_internals/resources.grd": { "ui/chromeos/ui_chromeos_strings.grd": {
"includes": [29000], "messages": [25920],
}, },
# Chromium strings and Google Chrome strings must start at the same id. "ui/file_manager/file_manager_resources.grd": {
# We only use one file depending on whether we're building Chromium or "includes": [26150],
# Google Chrome.
"components/components_chromium_strings.grd": {
"messages": [29280],
}, },
"components/components_google_chrome_strings.grd": { "ui/keyboard/keyboard_resources.grd": {
"messages": [29280], "includes": [26400],
}, },
"components/resources/components_resources.grd": { "ui/login/login_resources.grd": {
"includes": [29330], "includes": [26500],
}, },
"components/resources/components_scaled_resources.grd": { "ui/resources/ui_resources.grd": {
"structures": [29880], "structures": [26600],
}, },
"third_party/WebKit/public/blink_resources.grd": { "ui/resources/ui_unscaled_resources.grd": {
"includes": [30100], "includes": [26850],
"structures": [30400],
}, },
"chrome/browser/resources/md_policy/policy_resources.grd": { "ui/strings/app_locale_settings.grd": {
"structures": [30630], "messages": [26900],
}, },
"chrome/browser/resources/settings/settings_resources.grd": { "ui/strings/ui_strings.grd": {
"structures": [30650], "messages": [26950],
}, },
"headless/lib/resources/headless_lib_resources.grd": { "ui/views/resources/views_resources.grd": {
"includes": [30670], "structures": [27150],
}, },
"blimp/engine/app/blimp_browser_resources.grd": { "ui/webui/resources/webui_resources.grd": {
"includes": [30680], "includes": [27450],
"structures": [27650],
}, },
"chromecast/browser/cast_browser_resources.grd": {
"includes": [30690], # This file is generated during the build.
"<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd": {
"includes": [28450],
}, },
"blimp/client/support/resources/blimp_strings.grd": { "devtools_resources.grd": {
"messages": [30700], "includes": [28450],
}, },
# END "everything else" section.
# Everything but chrome/, components/, content/, and ios/
# Thinking about appending to the end?
# Please read the header and find the right section above instead.
# Resource ids starting at 31000 are reserved for projects built on Chromium. # Resource ids starting at 31000 are reserved for projects built on Chromium.
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment