summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/app.gyp34
-rw-r--r--build/common.gypi10
-rw-r--r--build/grit_action.gypi39
-rw-r--r--build/grit_target.gypi29
-rw-r--r--chrome/app/policy/policy_templates.gypi53
-rw-r--r--chrome/chrome.gyp345
-rw-r--r--chrome/default_plugin/default_plugin.gyp32
-rw-r--r--chrome_frame/chrome_frame.gyp38
-rw-r--r--net/net.gyp43
-rwxr-xr-xtools/grit/grit_info.py3
-rw-r--r--ui/base/strings/ui_strings.gyp56
-rw-r--r--ui/ui_gfx.gypi36
12 files changed, 263 insertions, 455 deletions
diff --git a/app/app.gyp b/app/app.gyp
index fc10ca0..8fd7315 100644
--- a/app/app.gyp
+++ b/app/app.gyp
@@ -4,13 +4,7 @@
{
'variables': {
- # TODO: remove this helper when we have loops in GYP
- 'apply_locales_cmd': ['python', '<(DEPTH)/build/apply_locales.py',],
'chromium_code': 1,
- 'grit_info_cmd': ['python', '../tools/grit/grit_info.py',
- '<@(grit_defines)'],
- 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/app',
- 'grit_cmd': ['python', '../tools/grit/grit.py'],
},
'includes': [
'app_base.gypi',
@@ -92,35 +86,19 @@
'target_name': 'app_resources',
'type': 'none',
'msvs_guid': '3FBC4235-3FBD-46DF-AEDC-BADBBA13A095',
+ 'variables': {
+ 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/app/app_resources',
+ },
'actions': [
{
'action_name': 'app_resources',
'variables': {
- 'input_path': 'resources/app_resources.grd',
+ 'grit_grd_file': 'resources/app_resources.grd',
},
- 'inputs': [
- '<!@(<(grit_info_cmd) --inputs <(input_path))',
- ],
- 'outputs': [
- '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)/app_resources\' <(input_path))',
- ],
- 'action': ['<@(grit_cmd)',
- '-i', '<(input_path)', 'build',
- '-o', '<(grit_out_dir)/app_resources',
- '<@(grit_defines)' ],
- 'message': 'Generating resources from <(input_path)',
+ 'includes': [ '../build/grit_action.gypi' ],
},
],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(grit_out_dir)/app_resources',
- ],
- },
- 'conditions': [
- ['OS=="win"', {
- 'dependencies': ['../build/win/system.gyp:cygwin'],
- }],
- ],
+ 'includes': [ '../build/grit_target.gypi' ],
},
],
}
diff --git a/build/common.gypi b/build/common.gypi
index 644c9ed..b911258 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -494,13 +494,15 @@
'use_gconf%': 1,
}],
- # Setup -D flags passed into grit.
+ # Set up -D and -E flags passed into grit.
['branding=="Chrome"', {
# TODO(mmoss) The .grd files look for _google_chrome, but for
# consistency they should look for google_chrome_build like C++.
- 'grit_defines': ['-D', '_google_chrome'],
+ 'grit_defines': ['-D', '_google_chrome',
+ '-E', 'CHROMIUM_BUILD=google_chrome'],
}, {
- 'grit_defines': ['-D', '_chromium'],
+ 'grit_defines': ['-D', '_chromium',
+ '-E', 'CHROMIUM_BUILD=chromium'],
}],
['chromeos==1', {
'grit_defines': ['-D', 'chromeos'],
@@ -1529,7 +1531,7 @@
'psapi.lib',
'dbghelp.lib',
],
- 'conditions': [
+ 'conditions': [
['msvs_express', {
# Explicitly required when using the ATL with express
'AdditionalDependencies': [
diff --git a/build/grit_action.gypi b/build/grit_action.gypi
new file mode 100644
index 0000000..041d704
--- /dev/null
+++ b/build/grit_action.gypi
@@ -0,0 +1,39 @@
+# 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 meant to be included into an action to invoke grit in a
+# consistent manner. To use this the following variables need to be
+# defined:
+# grit_grd_file: string: grd file path
+# grit_out_dir: string: the output directory path
+
+# It would be really nice to do this with a rule instead of actions, but it
+# would need to determine inputs and outputs via grit_info on a per-file
+# basis. GYP rules don’t currently support that. They could be extended to
+# do this, but then every generator would need to be updated to handle this.
+
+{
+ 'variables': {
+ 'grit_info_cmd': ['python', '<(DEPTH)/tools/grit/grit_info.py',
+ '<@(grit_defines)'],
+ 'grit_cmd': ['python', '<(DEPTH)/tools/grit/grit.py'],
+ },
+ 'inputs': [
+ '<!@(<(grit_info_cmd) --inputs <(grit_grd_file))',
+ ],
+ 'outputs': [
+ '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(grit_grd_file))',
+ ],
+ 'action': ['<@(grit_cmd)',
+ '-i', '<(grit_grd_file)', 'build',
+ '-o', '<(grit_out_dir)',
+ '<@(grit_defines)' ],
+ 'message': 'Generating resources from <(grit_grd_file)',
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2:
diff --git a/build/grit_target.gypi b/build/grit_target.gypi
new file mode 100644
index 0000000..c8998e1
--- /dev/null
+++ b/build/grit_target.gypi
@@ -0,0 +1,29 @@
+# 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 meant to be included into a target that will have one or more
+# uses of grit_action.gypi. To use this the following variables need to be
+# defined:
+# grit_out_dir: string: the output directory path
+
+# NOTE: This file is optional, not all targets that use grit include it, some
+# do their own custom directives instead.
+{
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '<(grit_out_dir)',
+ ],
+ },
+ 'conditions': [
+ ['OS=="win"', {
+ 'dependencies': ['<(DEPTH)/build/win/system.gyp:cygwin'],
+ }],
+ ],
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2:
diff --git a/chrome/app/policy/policy_templates.gypi b/chrome/app/policy/policy_templates.gypi
index 00927d8..4b9dd72 100644
--- a/chrome/app/policy/policy_templates.gypi
+++ b/chrome/app/policy/policy_templates.gypi
@@ -12,56 +12,24 @@
'target_name': 'policy_templates',
'type': 'none',
'variables': {
- 'grd_path': 'policy_templates.grd',
- 'template_files': [
- '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(grd_path))'
- ],
+ 'grit_grd_file': 'policy_templates.grd',
+ 'grit_info_cmd': ['python', '<(DEPTH)/tools/grit/grit_info.py',
+ '<@(grit_defines)'],
},
+ 'includes': [ '../../../build/grit_target.gypi' ],
'actions': [
{
'action_name': 'policy_templates',
- 'variables': {
- 'conditions': [
- ['branding=="Chrome"', {
- # TODO(mmoss) The .grd files look for _google_chrome, but
- # for consistency they should look for GOOGLE_CHROME_BUILD
- # like C++.
- # Clean this up when Windows moves to gyp.
- 'chrome_build': '_google_chrome',
- }, { # else: branding!="Chrome"
- 'chrome_build': '_chromium',
- }],
- ],
- },
- 'inputs': [
- '<!@(<(grit_info_cmd) --inputs <(grd_path))',
- ],
- 'outputs': [
- '<@(template_files)'
- ],
- 'action': [
- '<@(grit_cmd)',
- '-i', '<(grd_path)', 'build',
- '-o', '<(grit_out_dir)',
- '<@(grit_defines)',
- ],
- 'conditions': [
- ['OS == "mac"', {
- 'action': ['-D', 'mac_bundle_id=<(mac_bundle_id)'],
- }],
- ],
- 'message': 'Generating policy templates from <(grd_path)',
+ 'includes': [ '../../../build/grit_action.gypi' ],
},
],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(grit_out_dir)',
- ],
- },
'conditions': [
['OS=="win"', {
'variables': {
'version_path': '<(grit_out_dir)/app/policy/VERSION',
+ 'template_files': [
+ '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(grit_grd_file))'
+ ],
},
'actions': [
{
@@ -98,10 +66,7 @@
}
]
}],
- ['OS=="win"', {
- 'dependencies': ['../build/win/system.gyp:cygwin'],
- }],
- ],
+ ], # conditions
},
], # 'targets'
}], # OS=="win" or OS=="mac" or OS=="linux"
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index dd37150..7355282 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -42,32 +42,6 @@
'allocator_target': '../base/allocator/allocator.gyp:allocator',
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
- 'chrome_strings_grds': [
- # Localizable resources.
- 'app/resources/locale_settings.grd',
- 'app/chromium_strings.grd',
- 'app/generated_resources.grd',
- 'app/google_chrome_strings.grd',
- ],
- 'chrome_resources_grds': [
- # Data resources.
- 'browser/autofill/autofill_resources.grd',
- 'browser/browser_resources.grd',
- 'common/common_resources.grd',
- 'renderer/renderer_resources.grd',
- ],
- 'chrome_extra_resources_grds': [
- # These resources end up in resources.pak because they are resources
- # used by internal pages. Putting them in a spearate pak file makes
- # it easier for us to reference them internally.
- 'browser/resources/component_extension_resources.grd',
- 'browser/resources/net_internals_resources.grd',
- 'browser/resources/shared_resources.grd',
- 'browser/resources/sync_internals_resources.grd',
- ],
- 'grit_info_cmd': ['python', '../tools/grit/grit_info.py',
- '<@(grit_defines)'],
- 'grit_cmd': ['python', '../tools/grit/grit.py'],
'repack_locales_cmd': ['python', 'tools/build/repack_locales.py'],
# TODO: remove this helper when we have loops in GYP
'apply_locales_cmd': ['python', '<(DEPTH)/build/apply_locales.py'],
@@ -111,9 +85,13 @@
['branding=="Chrome"', {
'mac_bundle_id': 'com.google.Chrome',
'mac_creator': 'rimZ',
+ # The policy .grd file also needs the bundle id.
+ 'grit_defines': ['-D', 'mac_bundle_id=com.google.Chrome'],
}, { # else: branding!="Chrome"
'mac_bundle_id': 'org.chromium.Chromium',
'mac_creator': 'Cr24',
+ # The policy .grd file also needs the bundle id.
+ 'grit_defines': ['-D', 'mac_bundle_id=org.chromium.Chromium'],
}], # branding
], # conditions
}], # OS=="mac"
@@ -160,62 +138,38 @@
'target_name': 'chrome_resources',
'type': 'none',
'msvs_guid': 'B95AB527-F7DB-41E9-AD91-EB51EE0F56BE',
- 'variables': {
- 'chrome_resources_inputs': [
- '<!@(<(grit_info_cmd) --inputs <(chrome_resources_grds))',
- ],
- },
- 'rules': [
+ 'actions': [
+ # Data resources.
{
- 'rule_name': 'grit',
- 'extension': 'grd',
+ 'action_name': 'autofill_resources',
'variables': {
- 'conditions': [
- ['branding=="Chrome"', {
- 'branded_env': 'CHROMIUM_BUILD=google_chrome',
- }, { # else: branding!="Chrome"
- 'branded_env': 'CHROMIUM_BUILD=chromium',
- }],
- ],
+ 'grit_grd_file': 'browser/autofill/autofill_resources.grd',
},
- 'inputs': [
- '<@(chrome_resources_inputs)',
- ],
- 'outputs': [
- '<(grit_out_dir)/grit/<(RULE_INPUT_ROOT).h',
- '<(grit_out_dir)/<(RULE_INPUT_ROOT).pak',
- # TODO(bradnelson): move to something like this instead
- #'<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(chrome_resources_grds))',
- # This currently cannot work because gyp only evaluates the
- # outputs once (rather than per case where the rule applies).
- # This means you end up with all the outputs from all the grd
- # files, which angers scons and confuses vstudio.
- # One alternative would be to turn this into several actions,
- # but that would be rather verbose.
- ],
- 'action': ['<@(grit_cmd)', '-i',
- '<(RULE_INPUT_PATH)',
- 'build', '-o', '<(grit_out_dir)',
- '-E', '<(branded_env)',
- '<@(grit_defines)',
- ],
- 'message': 'Generating resources from <(RULE_INPUT_PATH)',
+ 'includes': [ '../build/grit_action.gypi' ],
+ },
+ {
+ 'action_name': 'browser_resources',
+ 'variables': {
+ 'grit_grd_file': 'browser/browser_resources.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
+ },
+ {
+ 'action_name': 'common_resources',
+ 'variables': {
+ 'grit_grd_file': 'common/common_resources.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
+ },
+ {
+ 'action_name': 'renderer_resources',
+ 'variables': {
+ 'grit_grd_file': 'renderer/renderer_resources.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
},
],
- 'sources': [
- '<@(chrome_resources_grds)',
- '<@(chrome_resources_inputs)',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(grit_out_dir)',
- ],
- },
- 'conditions': [
- ['OS=="win"', {
- 'dependencies': ['../build/win/system.gyp:cygwin'],
- }],
- ],
+ 'includes': [ '../build/grit_target.gypi' ],
},
{
# TODO(mark): It would be better if each static library that needed
@@ -233,54 +187,45 @@
# the type and making sure we depend on installer_util_strings, it
# will always get built before installer_util.
'type': 'dummy_executable',
- 'dependencies': ['../build/win/system.gyp:cygwin',
- 'installer_util_strings',],
+ 'dependencies': ['installer_util_strings'],
}, {
'type': 'none',
}],
],
- 'variables': {
- 'chrome_strings_inputs': [
- '<!@(<(grit_info_cmd) --inputs <(chrome_strings_grds))',
- ],
- },
- 'rules': [
+ 'actions': [
+ # Localizable resources.
{
- 'rule_name': 'grit',
- 'extension': 'grd',
- 'inputs': [
- '<@(chrome_strings_inputs)',
- ],
- 'outputs': [
- '<(grit_out_dir)/grit/<(RULE_INPUT_ROOT).h',
- # TODO: remove this helper when we have loops in GYP
- '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(RULE_INPUT_ROOT)_ZZLOCALE.pak\' <(locales))',
- # TODO(bradnelson): move to something like this
- #'<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(chrome_strings_grds))',
- # See comment in chrome_resources as to why.
- ],
- 'action': ['<@(grit_cmd)', '-i',
- '<(RULE_INPUT_PATH)',
- 'build', '-o', '<(grit_out_dir)',
- '<@(grit_defines)' ],
- 'message': 'Generating resources from <(RULE_INPUT_PATH)',
+ 'action_name': 'locale_settings',
+ 'variables': {
+ 'grit_grd_file': 'app/resources/locale_settings.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
+ },
+ {
+ 'action_name': 'chromium_strings.grd',
+ 'variables': {
+ 'grit_grd_file': 'app/chromium_strings.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
+ },
+ {
+ 'action_name': 'generated_resources',
+ 'variables': {
+ 'grit_grd_file': 'app/generated_resources.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
+ },
+ {
+ 'action_name': 'google_chrome_strings',
+ 'variables': {
+ 'grit_grd_file': 'app/google_chrome_strings.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
},
],
- 'sources': [
- '<@(chrome_strings_grds)',
- '<@(chrome_strings_inputs)',
- ],
- 'include_dirs': [
- '<(grit_out_dir)',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(grit_out_dir)',
- ],
- },
+ 'includes': [ '../build/grit_target.gypi' ],
},
{
- # theme_resources also generates a .cc file, so it can't use the rules above.
'target_name': 'theme_resources',
'type': 'none',
'msvs_guid' : 'A158FB0A-25E4-6523-6B5A-4BB294B73D31',
@@ -288,138 +233,92 @@
{
'action_name': 'theme_resources',
'variables': {
- 'input_path': 'app/theme/theme_resources.grd',
+ 'grit_grd_file': 'app/theme/theme_resources.grd',
},
- 'inputs': [
- '<!@(<(grit_info_cmd) --inputs <(input_path))',
- ],
- 'outputs': [
- '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(input_path))',
- ],
- 'action': [
- '<@(grit_cmd)',
- '-i', '<(input_path)', 'build',
- '-o', '<(grit_out_dir)',
- '<@(grit_defines)',
- ],
- 'message': 'Generating resources from <(input_path)',
+ 'includes': [ '../build/grit_action.gypi' ],
},
],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(grit_out_dir)',
- ],
- },
- 'conditions': [
- ['OS=="win"', {
- 'dependencies': ['../build/win/system.gyp:cygwin'],
- }],
- ],
+ 'includes': [ '../build/grit_target.gypi' ],
},
{
- # locale_settings_<platform>.grd have slightly different outputs, so it
- # can't use chrome_strings rules above.
'target_name': 'platform_locale_settings',
'type': 'none',
'actions': [
{
'action_name': 'platform_locale_settings',
'variables': {
- 'input_path': '<(platform_locale_settings_grd)',
+ 'grit_grd_file': '<(platform_locale_settings_grd)',
},
- 'inputs': [
- '<!@(<(grit_info_cmd) --inputs <(input_path))',
- ],
- 'outputs': [
- '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(input_path))',
- ],
- 'action': [
- '<@(grit_cmd)',
- '-i', '<(input_path)', 'build',
- '-o', '<(grit_out_dir)',
- '<@(grit_defines)',
- ],
- 'message': 'Generating resources from <(input_path)',
+ 'includes': [ '../build/grit_action.gypi' ],
},
],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(grit_out_dir)',
- ],
- },
- 'conditions': [
- ['OS=="win"', {
- 'dependencies': ['../build/win/system.gyp:cygwin'],
- }],
- ],
+ 'includes': [ '../build/grit_target.gypi' ],
},
{
'target_name': 'chrome_extra_resources',
'type': 'none',
- 'variables': {
- 'chrome_extra_resources_inputs': [
- '<!@(<(grit_info_cmd) --inputs <(chrome_extra_resources_grds))',
- ],
- },
- 'rules': [
+ 'dependencies': [
+ '../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:generate_devtools_grd',
+ ],
+ # These resources end up in resources.pak because they are resources
+ # used by internal pages. Putting them in a spearate pak file makes
+ # it easier for us to reference them internally.
+ 'actions': [
{
- 'rule_name': 'grit',
- 'extension': 'grd',
+ 'action_name': 'component_extension_resources',
'variables': {
- 'conditions': [
- ['branding=="Chrome"', {
- 'branded_env': 'CHROMIUM_BUILD=google_chrome',
- }, { # else: branding!="Chrome"
- 'branded_env': 'CHROMIUM_BUILD=chromium',
- }],
- ],
+ 'grit_grd_file': 'browser/resources/component_extension_resources.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
+ },
+ {
+ 'action_name': 'net_internals_resources',
+ 'variables': {
+ 'grit_grd_file': 'browser/resources/net_internals_resources.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
+ },
+ {
+ 'action_name': 'shared_resources',
+ 'variables': {
+ 'grit_grd_file': 'browser/resources/shared_resources.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
+ },
+ {
+ 'action_name': 'sync_internals_resources',
+ 'variables': {
+ 'grit_grd_file': 'browser/resources/sync_internals_resources.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
+ },
+ {
+ 'action_name': 'devtools_resources',
+ # This can't use ../build/grit_action.gypi because the grd file
+ # is generated a build time, so the trick of using grit_info to get
+ # the real inputs/outputs at GYP time isn't possible.
+ 'variables': {
+ 'grit_cmd': ['python', '../tools/grit/grit.py'],
+ 'grit_grd_file': '<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd',
},
'inputs': [
- '<@(chrome_extra_resources_inputs)',
- '<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd',
+ '<(grit_grd_file)',
],
'outputs': [
- '<(grit_out_dir)/grit/<(RULE_INPUT_ROOT).h',
- '<(grit_out_dir)/<(RULE_INPUT_ROOT).pak',
- '<(grit_out_dir)/grit/<(RULE_INPUT_ROOT)_map.cc',
- '<(grit_out_dir)/grit/<(RULE_INPUT_ROOT)_map.h',
- # TODO(bradnelson): move to something like this instead
- #'<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(chrome_resources_grds))',
- # This currently cannot work because gyp only evaluates the
- # outputs once (rather than per case where the rule applies).
- # This means you end up with all the outputs from all the grd
- # files, which angers scons and confuses vstudio.
- # One alternative would be to turn this into several actions,
- # but that would be rather verbose.
- ],
- 'action': ['<@(grit_cmd)', '-i',
- '<(RULE_INPUT_PATH)',
- 'build', '-o', '<(grit_out_dir)',
- '-D', 'SHARED_INTERMEDIATE_DIR=<(SHARED_INTERMEDIATE_DIR)',
- '-E', '<(branded_env)',
- '<@(grit_defines)',
- ],
- 'message': 'Generating resources from <(RULE_INPUT_PATH)',
+ '<(grit_out_dir)/grit/devtools_resources.h',
+ '<(grit_out_dir)/devtools_resources.pak',
+ '<(grit_out_dir)/grit/devtools_resources_map.cc',
+ '<(grit_out_dir)/grit/devtools_resources_map.h',
+ ],
+ 'action': ['<@(grit_cmd)',
+ '-i', '<(grit_grd_file)', 'build',
+ '-o', '<(grit_out_dir)',
+ '-D', 'SHARED_INTERMEDIATE_DIR=<(SHARED_INTERMEDIATE_DIR)',
+ '<@(grit_defines)' ],
+ 'message': 'Generating resources from <(grit_grd_file)',
},
],
- 'sources': [
- '<@(chrome_extra_resources_grds)',
- '<@(chrome_extra_resources_inputs)',
- '<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd',
- ],
- 'dependencies': [
- '../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:generate_devtools_grd',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(grit_out_dir)',
- ],
- },
- 'conditions': [
- ['OS=="win"', {
- 'dependencies': ['../build/win/system.gyp:cygwin'],
- }],
- ],
+ 'includes': [ '../build/grit_target.gypi' ],
},
{
'target_name': 'default_extensions',
@@ -954,7 +853,7 @@
'sources': [
'tools/ipclist/all_messages.h',
'tools/ipclist/ipclist.cc',
- ],
+ ],
},
],
'conditions': [
diff --git a/chrome/default_plugin/default_plugin.gyp b/chrome/default_plugin/default_plugin.gyp
index 3af4a66..d468dee 100644
--- a/chrome/default_plugin/default_plugin.gyp
+++ b/chrome/default_plugin/default_plugin.gyp
@@ -5,10 +5,6 @@
{
'variables': {
'chromium_code': 1,
- 'grit_info_cmd': ['python', '../../tools/grit/grit_info.py',
- '<@(grit_defines)'],
- 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
- 'grit_cmd': ['python', '../../tools/grit/grit.py'],
},
'targets': [
{
@@ -66,35 +62,19 @@
{
'target_name': 'default_plugin_resources',
'type': 'none',
+ 'variables': {
+ 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome/default_plugin_resources',
+ },
'actions': [
{
'action_name': 'default_plugin_resources',
'variables': {
- 'input_path': 'default_plugin_resources.grd',
+ 'grit_grd_file': 'default_plugin_resources.grd',
},
- 'inputs': [
- '<!@(<(grit_info_cmd) --inputs <(input_path))',
- ],
- 'outputs': [
- '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)/default_plugin_resources\' <(input_path))',
- ],
- 'action': ['<@(grit_cmd)',
- '-i', '<(input_path)', 'build',
- '-o', '<(grit_out_dir)/default_plugin_resources',
- '<@(grit_defines)'],
- 'message': 'Generating resources from <(input_path)',
+ 'includes': [ '../../build/grit_action.gypi' ],
},
],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(grit_out_dir)/default_plugin_resources',
- ],
- },
- 'conditions': [
- ['OS=="win"', {
- 'dependencies': ['../../build/win/system.gyp:cygwin'],
- }],
- ],
+ 'includes': [ '../../build/grit_target.gypi' ],
},
],
}
diff --git a/chrome_frame/chrome_frame.gyp b/chrome_frame/chrome_frame.gyp
index 9449d60..a6c57fa 100644
--- a/chrome_frame/chrome_frame.gyp
+++ b/chrome_frame/chrome_frame.gyp
@@ -691,41 +691,19 @@
{
'target_name': 'chrome_frame_strings',
'type': 'none',
- 'rules': [
+ 'variables': {
+ 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome_frame',
+ },
+ 'actions': [
{
- 'rule_name': 'grit',
- 'extension': 'grd',
- 'inputs': [
- '../tools/grit/grit.py',
- ],
+ 'action_name': 'chrome_frame_resources',
'variables': {
- 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome_frame',
+ 'grit_grd_file': 'resources/chrome_frame_resources.grd',
},
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/chrome_frame/grit/<(RULE_INPUT_ROOT).h',
- '<(SHARED_INTERMEDIATE_DIR)/chrome_frame/<(RULE_INPUT_ROOT).pak',
- ],
- 'action': ['python', '<@(_inputs)', '-i',
- '<(RULE_INPUT_PATH)',
- 'build', '-o', '<(grit_out_dir)'
- ],
- 'message': 'Generating resources from <(RULE_INPUT_PATH)',
+ 'includes': [ '../build/grit_action.gypi' ],
},
],
- 'sources': [
- # Localizable resources.
- 'resources/chrome_frame_resources.grd',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(SHARED_INTERMEDIATE_DIR)/chrome_frame',
- ],
- },
- 'conditions': [
- ['OS=="win"', {
- 'dependencies': ['../build/win/system.gyp:cygwin'],
- }],
- ],
+ 'includes': [ '../build/grit_target.gypi' ],
},
{
'target_name': 'chrome_frame_utils',
diff --git a/net/net.gyp b/net/net.gyp
index e3837de..516ce00 100644
--- a/net/net.gyp
+++ b/net/net.gyp
@@ -1233,45 +1233,18 @@
'type': 'none',
'msvs_guid': '8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942',
'variables': {
- 'grit_cmd': ['python', '../tools/grit/grit.py'],
- 'grit_info_cmd': ['python', '../tools/grit/grit_info.py',
- '<@(grit_defines)'],
- 'input_paths': [
- 'base/net_resources.grd',
- ],
+ 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/net',
},
- 'rules': [
+ 'actions': [
{
- 'rule_name': 'grit',
- 'extension': 'grd',
- 'inputs': [
- '<!@(<(grit_info_cmd) --inputs <(input_paths))',
- ],
- 'outputs': [
- '<!@(<(grit_info_cmd) '
- '--outputs \'<(SHARED_INTERMEDIATE_DIR)/net\' <(input_paths))',
- ],
- 'action':
- ['<@(grit_cmd)',
- '-i', '<(RULE_INPUT_PATH)', 'build',
- '-o', '<(SHARED_INTERMEDIATE_DIR)/net',
- '<@(grit_defines)'],
- 'message': 'Generating resources from <(RULE_INPUT_PATH)',
+ 'action_name': 'net_resources',
+ 'variables': {
+ 'grit_grd_file': 'base/net_resources.grd',
+ },
+ 'includes': [ '../build/grit_action.gypi' ],
},
],
- 'sources': [
- '<@(input_paths)',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(SHARED_INTERMEDIATE_DIR)/net',
- ],
- },
- 'conditions': [
- ['OS=="win"', {
- 'dependencies': ['../build/win/system.gyp:cygwin'],
- }],
- ],
+ 'includes': [ '../build/grit_target.gypi' ],
},
{
'target_name': 'fetch_client',
diff --git a/tools/grit/grit_info.py b/tools/grit/grit_info.py
index cf80954..9bb7c430 100755
--- a/tools/grit/grit_info.py
+++ b/tools/grit/grit_info.py
@@ -83,6 +83,9 @@ def main(argv):
parser.add_option("--inputs", action="store_true", dest="inputs")
parser.add_option("--outputs", action="store_true", dest="outputs")
parser.add_option("-D", action="append", dest="defines", default=[])
+ # grit build also supports '-E KEY=VALUE', support that to share command
+ # line flags.
+ parser.add_option("-E", action="append", dest="build_env", default=[])
options, args = parser.parse_args()
diff --git a/ui/base/strings/ui_strings.gyp b/ui/base/strings/ui_strings.gyp
index a561508..257a9da 100644
--- a/ui/base/strings/ui_strings.gyp
+++ b/ui/base/strings/ui_strings.gyp
@@ -1,49 +1,35 @@
{
'variables': {
- # TODO: remove this helper when we have loops in GYP
- 'apply_locales_cmd': ['python', '<(DEPTH)/build/apply_locales.py',],
'chromium_code': 1,
- 'grit_cmd': ['python', '../../../tools/grit/grit.py'],
- 'grit_info_cmd': ['python', '../../../tools/grit/grit_info.py',
- '<@(grit_defines)'],
- 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/app',
- 'localizable_resources': [
- 'app_locale_settings.grd',
- 'app_strings.grd',
- ],
+ 'grit_base_out_dir': '<(SHARED_INTERMEDIATE_DIR)/app',
},
'targets': [
{
'target_name': 'ui_strings',
'type': 'none',
'msvs_guid': 'BC3C49A3-D061-4E78-84EE-742DA064DC46',
- 'rules': [
+ 'actions': [
{
- 'rule_name': 'grit',
- 'extension': 'grd',
- 'inputs': [
- '<!@(<(grit_info_cmd) --inputs <(localizable_resources))',
- ],
- 'outputs': [
- '<(grit_out_dir)/<(RULE_INPUT_ROOT)/grit/<(RULE_INPUT_ROOT).h',
- # TODO: remove this helper when we have loops in GYP
- '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(RULE_INPUT_ROOT)/<(RULE_INPUT_ROOT)_ZZLOCALE.pak\' <(locales))',
- ],
- 'action': [
- '<@(grit_cmd)',
- '-i', '<(RULE_INPUT_PATH)', 'build',
- '-o', '<(grit_out_dir)/<(RULE_INPUT_ROOT)',
- '<@(grit_defines)'],
- 'message': 'Generating resources from <(RULE_INPUT_PATH)',
+ 'action_name': 'app_strings',
+ 'variables': {
+ 'grit_grd_file': 'app_strings.grd',
+ 'grit_out_dir': '<(grit_base_out_dir)/app_strings',
+ },
+ 'includes': [ '../../../build/grit_action.gypi' ],
+ },
+ {
+ 'action_name': 'app_locale_settings',
+ 'variables': {
+ 'grit_grd_file': 'app_locale_settings.grd',
+ 'grit_out_dir': '<(grit_base_out_dir)/app_locale_settings',
+ },
+ 'includes': [ '../../../build/grit_action.gypi' ],
},
- ],
- 'sources': [
- '<@(localizable_resources)',
],
'direct_dependent_settings': {
'include_dirs': [
- '<(grit_out_dir)/app_locale_settings',
- '<(grit_out_dir)/app_strings',
+ '<(grit_base_out_dir)/app_locale_settings',
+ '<(grit_base_out_dir)/app_strings',
],
},
'conditions': [
@@ -66,8 +52,8 @@
'action_name': 'repack_ui_unittest_strings',
'variables': {
'pak_inputs': [
- '<(grit_out_dir)/app_strings/app_strings_en-US.pak',
- '<(grit_out_dir)/app_locale_settings/app_locale_settings_en-US.pak',
+ '<(grit_base_out_dir)/app_strings/app_strings_en-US.pak',
+ '<(grit_base_out_dir)/app_locale_settings/app_locale_settings_en-US.pak',
],
},
'inputs': [
@@ -85,7 +71,7 @@
{
'destination': '<(PRODUCT_DIR)/app_unittests_strings',
'files': [
- '<(grit_out_dir)/app_resources/app_resources.pak',
+ '<(grit_base_out_dir)/app_resources/app_resources.pak',
],
},
],
diff --git a/ui/ui_gfx.gypi b/ui/ui_gfx.gypi
index 1670328..1673b90 100644
--- a/ui/ui_gfx.gypi
+++ b/ui/ui_gfx.gypi
@@ -3,12 +3,6 @@
# found in the LICENSE file.
{
- 'variables': {
- 'grit_info_cmd': ['python', '../tools/grit/grit_info.py',
- '<@(grit_defines)'],
- 'grit_cmd': ['python', '../tools/grit/grit.py'],
- 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/ui/gfx',
- },
'targets': [
{
# TODO(rsesek): Remove this target once ui_unittests is run on the
@@ -164,37 +158,19 @@
'target_name': 'gfx_resources',
'type': 'none',
'msvs_guid' : '5738AE53-E919-4987-A2EF-15FDBD8F90F6',
+ 'variables': {
+ 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/ui/gfx',
+ },
'actions': [
{
'action_name': 'gfx_resources',
'variables': {
- 'input_path': 'gfx/gfx_resources.grd',
+ 'grit_grd_file': 'gfx/gfx_resources.grd',
},
- 'inputs': [
- '<!@(<(grit_info_cmd) --inputs <(input_path))',
- ],
- 'outputs': [
- '<!@(<(grit_info_cmd) --outputs \'<(grit_out_dir)\' <(input_path))',
- ],
- 'action': [
- '<@(grit_cmd)',
- '-i', '<(input_path)', 'build',
- '-o', '<(grit_out_dir)',
- '<@(grit_defines)',
- ],
- 'message': 'Generating resources from <(input_path)',
+ 'includes': [ '../build/grit_action.gypi' ],
},
],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(grit_out_dir)',
- ],
- },
- 'conditions': [
- ['OS=="win"', {
- 'dependencies': ['../build/win/system.gyp:cygwin'],
- }],
- ],
+ 'includes': [ '../build/grit_target.gypi' ],
},
],