summaryrefslogtreecommitdiffstats
path: root/chrome/chrome.gyp
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-11 07:18:23 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-11 07:18:23 +0000
commit275538b9af4cc9869b9a80d0e1821b26f206b67c (patch)
treea457c2137b0025cf6d30b711eee533627df6e2dd /chrome/chrome.gyp
parent260d8a09246060bf045982c89adbd2881aac5585 (diff)
downloadchromium_src-275538b9af4cc9869b9a80d0e1821b26f206b67c.zip
chromium_src-275538b9af4cc9869b9a80d0e1821b26f206b67c.tar.gz
chromium_src-275538b9af4cc9869b9a80d0e1821b26f206b67c.tar.bz2
Move the resources used by net-internals into a pak file.
We don't use this yet, but the plan is to move everything in the resources directory into here. BUG=42770 Review URL: http://codereview.chromium.org/2667001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/chrome.gyp')
-rw-r--r--chrome/chrome.gyp109
1 files changed, 109 insertions, 0 deletions
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index f17ec10..e1dc2b6 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -55,6 +55,12 @@
'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/net_internals_resources.grd',
+ ],
'grit_info_cmd': ['python', '../tools/grit/grit_info.py'],
'grit_cmd': ['python', '../tools/grit/grit.py'],
'repack_locales_cmd': ['python', 'tools/build/repack_locales.py'],
@@ -411,6 +417,79 @@
],
},
{
+ 'target_name': 'chrome_extra_resources',
+ 'type': 'none',
+ 'variables': {
+ 'chrome_extra_resources_inputs': [
+ '<!@(<(grit_info_cmd) --inputs <(chrome_extra_resources_grds))',
+ ],
+ },
+ 'rules': [
+ {
+ 'rule_name': 'grit',
+ 'extension': 'grd',
+ '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',
+ 'branded_env': 'CHROMIUM_BUILD=google_chrome',
+ }, { # else: branding!="Chrome"
+ 'chrome_build': '_chromium',
+ 'branded_env': 'CHROMIUM_BUILD=chromium',
+ }],
+ ],
+ },
+ 'inputs': [
+ '<@(chrome_extra_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)',
+ '-D', '<(chrome_build)',
+ '-E', '<(branded_env)',
+ ],
+ 'conditions': [
+ ['chromeos==1', {
+ 'action': ['-D', 'chromeos'],
+ }],
+ ['use_titlecase_in_grd_files==1', {
+ 'action': ['-D', 'use_titlecase'],
+ }],
+ ],
+ 'message': 'Generating resources from <(RULE_INPUT_PATH)',
+ },
+ ],
+ 'sources': [
+ '<@(chrome_extra_resources_grds)',
+ '<@(chrome_extra_resources_inputs)',
+ ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '<(grit_out_dir)',
+ ],
+ },
+ 'conditions': [
+ ['OS=="win"', {
+ 'dependencies': ['../build/win/system.gyp:cygwin'],
+ }],
+ ],
+ },
+ {
'target_name': 'default_extensions',
'type': 'none',
'msvs_guid': 'DA9BAB64-91DC-419B-AFDE-6FF8C569E83A',
@@ -1344,6 +1423,36 @@
'tools/perf/flush_cache/flush_cache.cc',
],
},
+ {
+ # Mac needs 'process_outputs_as_mac_bundle_resources' to be set,
+ # and the option is only effective when the target type is native
+ # binary. Hence we cannot build the Mac bundle resources here and
+ # the action is duplicated in chrome_dll.gypi.
+ 'target_name': 'packed_extra_resources',
+ 'type': 'none',
+ 'variables': {
+ 'repack_path': '../tools/data_pack/repack.py',
+ },
+ 'actions': [
+ {
+ 'action_name': 'repack_resources',
+ 'variables': {
+ 'pak_inputs': [
+ '<(grit_out_dir)/net_internals_resources.pak',
+ ],
+ },
+ 'inputs': [
+ '<(repack_path)',
+ '<@(pak_inputs)',
+ ],
+ 'outputs': [
+ '<(PRODUCT_DIR)/resources.pak',
+ ],
+ 'action': ['python', '<(repack_path)', '<@(_outputs)',
+ '<@(pak_inputs)'],
+ },
+ ]
+ }
],
},], # OS!="mac"
['OS=="linux"',