diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-11 07:18:23 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-11 07:18:23 +0000 |
commit | 275538b9af4cc9869b9a80d0e1821b26f206b67c (patch) | |
tree | a457c2137b0025cf6d30b711eee533627df6e2dd /chrome | |
parent | 260d8a09246060bf045982c89adbd2881aac5585 (diff) | |
download | chromium_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')
-rw-r--r-- | chrome/browser/resources/net_internals_resources.grd | 36 | ||||
-rw-r--r-- | chrome/chrome.gyp | 109 | ||||
-rwxr-xr-x | chrome/chrome_browser.gypi | 1 | ||||
-rw-r--r-- | chrome/chrome_dll.gypi | 18 | ||||
-rw-r--r-- | chrome/chrome_exe.gypi | 3 | ||||
-rwxr-xr-x | chrome/chrome_tests.gypi | 4 |
6 files changed, 171 insertions, 0 deletions
diff --git a/chrome/browser/resources/net_internals_resources.grd b/chrome/browser/resources/net_internals_resources.grd new file mode 100644 index 0000000..a6f6da3 --- /dev/null +++ b/chrome/browser/resources/net_internals_resources.grd @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This comment is only here because changes to resources are not picked up +without changes to the corresponding grd file. paaaae --> +<grit latest_public_release="0" current_release="1"> + <outputs> + <output filename="grit/net_internals_resources.h" type="rc_header"> + <emit emit_type='prepend'></emit> + </output> + <output filename="net_internals_resources.pak" type="data_package" /> + <output filename="grit/net_internals_resources_map.h" type="resource_map_header" /> + <output filename="grit/net_internals_resources_map.cc" type="resource_file_map_source" /> + </outputs> + <release seq="1"> + <includes> + <include name="IDR_NET_INTERNALS_DATAVIEW" file="net_internals/dataview.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_DETAILSVIEW" file="net_internals/detailsview.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_DNSVIEW" file="net_internals/dnsview.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_HTTPCACHEVIEW" file="net_internals/httpcacheview.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_INDEX_HTML" file="net_internals/index.html" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_LOGGROUPER" file="net_internals/loggrouper.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_LOGVIEWPAINTER" file="net_internals/logviewpainter.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_MAIN_CSS" file="net_internals/main.css" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_MAIN" file="net_internals/main.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_PROXYVIEW" file="net_internals/proxyview.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_REQUESTSVIEW" file="net_internals/requestsview.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_RESIZABLEVERTICALSPLITVIEW" file="net_internals/resizableverticalsplitview.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_SOURCEENTRY" file="net_internals/sourceentry.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_TABSWITCHERVIEW" file="net_internals/tabswitcherview.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_TESTVIEW" file="net_internals/testview.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_TIMELINEVIEWPAINTER" file="net_internals/timelineviewpainter.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_TOPMIDBOTTOMVIEW" file="net_internals/topmidbottomview.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_UTIL" file="net_internals/util.js" type="BINDATA" /> + <include name="IDR_NET_INTERNALS_VIEW" file="net_internals/view.js" type="BINDATA" /> + </includes> + </release> +</grit> 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"', diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index f9ad2d2..8e87ee0 100755 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -11,6 +11,7 @@ 'dependencies': [ 'common', 'common_net', + 'chrome_extra_resources', 'chrome_resources', 'chrome_strings', 'chrome_version_info', diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi index 614746f..f892a1f 100644 --- a/chrome/chrome_dll.gypi +++ b/chrome/chrome_dll.gypi @@ -371,6 +371,24 @@ '<@(locales)', ], }, + { + 'action_name': 'repack_resources', + 'variables': { + 'pak_inputs': [ + '<(grit_out_dir)/net_internals_resources.pak', + ], + }, + 'inputs': [ + '<(repack_path)', + '<@(pak_inputs)', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/repack/resources.pak', + ], + 'action': ['python', '<(repack_path)', '<@(_outputs)', + '<@(pak_inputs)'], + 'process_outputs_as_mac_bundle_resources': 1, + }, ], 'postbuilds': [ { diff --git a/chrome/chrome_exe.gypi b/chrome/chrome_exe.gypi index bf4c6c5..33397ca 100644 --- a/chrome/chrome_exe.gypi +++ b/chrome/chrome_exe.gypi @@ -413,6 +413,9 @@ 'product_name': 'chrome' }], ], + 'dependencies': [ + 'packed_extra_resources', + ], }], ['OS=="mac" or OS=="win"', { 'dependencies': [ diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 041c8a2..d7fbb15 100755 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1936,6 +1936,10 @@ 'dependencies': [ 'helper_app' ], + },{ # OS!="mac" + 'dependencies': [ + 'packed_extra_resources', + ], }], ['OS=="linux" and chromeos==1', { 'include_dirs': [ |