diff options
author | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-03 15:32:12 +0000 |
---|---|---|
committer | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-03 15:32:12 +0000 |
commit | adf6b2e17687fc42a548898fb27347e74cb73918 (patch) | |
tree | efaab552c4d80d620d29eb8b1573b239d0de03f4 /chrome/chrome.gyp | |
parent | d0a37403abc06875bdcd7ea058891dc210867906 (diff) | |
download | chromium_src-adf6b2e17687fc42a548898fb27347e74cb73918.zip chromium_src-adf6b2e17687fc42a548898fb27347e74cb73918.tar.gz chromium_src-adf6b2e17687fc42a548898fb27347e74cb73918.tar.bz2 |
Revert 108466 - Introduces chromium_resources.gyp to factor out Chrome resource generation
1. Factors out Chrome/Chromium resource generation into a separate
chrome_resources.gyp file.
2. Eliminates repetition between Mac and other platforms.
3. Breaks long "repack" actions out into separate files for greater readability.
4. Eliminates circular dependencies in the Aura shell, the Views components, and
the compositor when utilizing Chrome resources.
BUG=none
TEST=try bots run gyps and build correctly.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=107967
Review URL: http://codereview.chromium.org/8425002
TBR=dhollowa@chromium.org
Review URL: http://codereview.chromium.org/8448001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108468 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/chrome.gyp')
-rw-r--r-- | chrome/chrome.gyp | 445 |
1 files changed, 436 insertions, 9 deletions
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 40c7ed7..2a76224 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -134,6 +134,229 @@ ], 'targets': [ { + # TODO(mark): It would be better if each static library that needed + # to run grit would list its own .grd files, but unfortunately some + # of the static libraries currently have circular dependencies among + # generated headers. + 'target_name': 'chrome_resources', + 'type': 'none', + 'actions': [ + # Data resources. + { + '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' ], + }, + ], + 'includes': [ '../build/grit_target.gypi' ], + }, + { + # TODO(mark): It would be better if each static library that needed + # to run grit would list its own .grd files, but unfortunately some + # of the static libraries currently have circular dependencies among + # generated headers. + 'target_name': 'chrome_strings', + 'type': 'none', + 'conditions': [ + ['OS=="win"', { + # HACK(nsylvain): We want to enforce a fake dependency on + # intaller_util_string. install_util depends on both + # chrome_strings and installer_util_strings, but for some reasons + # Incredibuild does not enforce it (most likely a bug). By changing + # the type and making sure we depend on installer_util_strings, it + # will always get built before installer_util. + 'type': 'dummy_executable', + 'dependencies': ['installer_util_strings'], + }], + ], + 'actions': [ + # Localizable resources. + { + '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' ], + }, + ], + 'includes': [ '../build/grit_target.gypi' ], + }, + { + 'target_name': 'theme_resources', + 'type': 'none', + 'actions': [ + { + 'action_name': 'theme_resources', + 'variables': { + 'grit_grd_file': 'app/theme/theme_resources.grd', + }, + 'includes': [ '../build/grit_action.gypi' ], + }, + { + 'action_name': 'theme_resources_large', + 'variables': { + 'grit_grd_file': 'app/theme/theme_resources_large.grd', + }, + 'includes': [ '../build/grit_action.gypi' ], + }, + { + 'action_name': 'theme_resources_standard', + 'variables': { + 'grit_grd_file': 'app/theme/theme_resources_standard.grd', + }, + 'includes': [ '../build/grit_action.gypi' ], + }, + ], + 'includes': [ '../build/grit_target.gypi' ], + }, + { + 'target_name': 'platform_locale_settings', + 'type': 'none', + 'actions': [ + { + 'action_name': 'platform_locale_settings', + 'variables': { + 'grit_grd_file': '<(platform_locale_settings_grd)', + }, + 'includes': [ '../build/grit_action.gypi' ], + }, + ], + 'includes': [ '../build/grit_target.gypi' ], + }, + { + 'target_name': 'chrome_extra_resources', + 'type': 'none', + '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': [ + { + 'action_name': 'component_extension_resources', + 'variables': { + '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': 'options_resources', + 'variables': { + 'grit_grd_file': 'browser/resources/options_resources.grd', + }, + 'includes': [ '../build/grit_action.gypi' ], + }, + { + 'action_name': 'quota_internals_resources', + 'variables': { + 'grit_grd_file': 'browser/resources/quota_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': 'workers_resources', + 'variables': { + 'grit_grd_file': 'browser/resources/workers_resources.grd', + }, + 'includes': [ '../build/grit_action.gypi' ], + }, + { + 'action_name': 'devtools_frontend_resources', + 'variables': { + 'grit_grd_file': + 'browser/debugger/frontend/devtools_frontend_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': [ + '<(grit_grd_file)', + '<!@pymod_do_main(grit_info --inputs)', + ], + 'outputs': [ + '<(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)', + }, + ], + 'includes': [ '../build/grit_target.gypi' ], + }, + { 'target_name': 'default_extensions', 'type': 'none', 'conditions': [ @@ -164,10 +387,10 @@ 'target_name': 'debugger', 'type': 'static_library', 'dependencies': [ - 'chrome_resources.gyp:chrome_extra_resources', - 'chrome_resources.gyp:chrome_resources', - 'chrome_resources.gyp:chrome_strings', - 'chrome_resources.gyp:theme_resources', + 'chrome_extra_resources', + 'chrome_resources', + 'chrome_strings', + 'theme_resources', '../base/base.gyp:base', '../content/content.gyp:content_browser', '../net/net.gyp:http_server', @@ -229,7 +452,7 @@ '..', '<(grit_out_dir)', ], - }, + }, { 'target_name': 'utility', 'type': 'static_library', @@ -598,7 +821,7 @@ 'target_name': 'service', 'type': 'static_library', 'dependencies': [ - 'chrome_resources.gyp:chrome_strings', + 'chrome_strings', 'common', 'common_net', '../base/base.gyp:base', @@ -931,7 +1154,7 @@ 'target_name': 'infoplist_strings_tool', 'type': 'executable', 'dependencies': [ - 'chrome_resources.gyp:chrome_strings', + 'chrome_strings', '../base/base.gyp:base', '../ui/ui.gyp:ui', ], @@ -988,8 +1211,49 @@ '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/grit/grit/format/repack.py', + }, + 'dependencies': [ + 'chrome_extra_resources', + ], + 'actions': [ + { + 'action_name': 'repack_resources', + 'variables': { + 'pak_inputs': [ + '<(grit_out_dir)/component_extension_resources.pak', + '<(grit_out_dir)/devtools_frontend_resources.pak', + '<(grit_out_dir)/devtools_resources.pak', + '<(grit_out_dir)/options_resources.pak', + '<(grit_out_dir)/net_internals_resources.pak', + '<(grit_out_dir)/quota_internals_resources.pak', + '<(grit_out_dir)/shared_resources.pak', + '<(grit_out_dir)/sync_internals_resources.pak', + '<(grit_out_dir)/workers_resources.pak', + ], + }, + 'inputs': [ + '<(repack_path)', + '<@(pak_inputs)', + ], + 'outputs': [ + '<(PRODUCT_DIR)/resources.pak', + ], + 'action': ['python', '<(repack_path)', '<@(_outputs)', + '<@(pak_inputs)'], + }, + ] + } ], - }], # OS!="mac" + },], # OS!="mac" ['OS=="linux"', { 'targets': [ { @@ -1218,7 +1482,7 @@ 'target_name': 'automation', 'type': 'static_library', 'dependencies': [ - 'chrome_resources.gyp:theme_resources', + 'theme_resources', '../base/base.gyp:test_support_base', '../skia/skia.gyp:skia', '../testing/gtest.gyp:gtest', @@ -1307,5 +1571,168 @@ }, ]}, # 'targets' ], # OS=="win" + ['OS != "mac"', { + 'targets': [{ + 'target_name': 'packed_resources', + 'type': 'none', + 'variables': { + 'repack_path': '../tools/grit/grit/format/repack.py', + }, + 'dependencies': [ + # MSVS needs the dependencies explictly named, Make is able to + # derive the dependencies from the output files. + 'chrome_resources', + 'chrome_strings', + 'default_plugin/default_plugin.gyp:default_plugin_resources', + 'platform_locale_settings', + 'theme_resources', + '<(DEPTH)/net/net.gyp:net_resources', + '<(DEPTH)/ui/base/strings/ui_strings.gyp:ui_strings', + '<(DEPTH)/ui/ui.gyp:gfx_resources', + '<(DEPTH)/ui/ui.gyp:ui_resources', + '<(DEPTH)/ui/ui.gyp:ui_resources_large', + '<(DEPTH)/ui/ui.gyp:ui_resources_standard', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_resources', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_strings', + ], + 'actions': [ + # TODO(mark): These actions are duplicated for the Mac in the + # chrome_dll target. Can they be unified? + # + # 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. + { + 'action_name': 'repack_chrome', + 'variables': { + 'pak_inputs': [ + '<(grit_out_dir)/browser_resources.pak', + '<(grit_out_dir)/common_resources.pak', + '<(grit_out_dir)/default_plugin_resources/default_plugin_resources.pak', + '<(grit_out_dir)/renderer_resources.pak', + '<(grit_out_dir)/theme_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak', + ], + 'conditions': [ + ['touchui==0', { + 'pak_inputs': [ + '<(grit_out_dir)/theme_resources_standard.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources_standard/ui_resources_standard.pak', + ], + }, { # else: touchui!=0 + 'pak_inputs': [ + '<(grit_out_dir)/theme_resources_large.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources_large/ui_resources_large.pak', + ], + }], + ], + }, + 'inputs': [ + '<(repack_path)', + '<@(pak_inputs)', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/repack/chrome.pak', + ], + 'action': ['python', '<(repack_path)', '<@(_outputs)', + '<@(pak_inputs)'], + }, + { + 'action_name': 'repack_locales', + 'variables': { + 'conditions': [ + ['branding=="Chrome"', { + 'branding_flag': ['-b', 'google_chrome',], + }, { # else: branding!="Chrome" + 'branding_flag': ['-b', 'chromium',], + }], + ], + }, + 'inputs': [ + 'tools/build/repack_locales.py', + '<!@pymod_do_main(repack_locales -i <(branding_flag) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(INTERMEDIATE_DIR) <(locales))' + ], + 'outputs': [ + '<!@pymod_do_main(repack_locales -o -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(INTERMEDIATE_DIR) <(locales))' + ], + 'action': [ + '<@(repack_locales_cmd)', + '<@(branding_flag)', + '-g', '<(grit_out_dir)', + '-s', '<(SHARED_INTERMEDIATE_DIR)', + '-x', '<(INTERMEDIATE_DIR)', + '<@(locales)', + ], + }, + { + 'action_name': 'repack_pseudo_locales', + 'variables': { + 'conditions': [ + ['branding=="Chrome"', { + 'branding_flag': ['-b', 'google_chrome',], + }, { # else: branding!="Chrome" + 'branding_flag': ['-b', 'chromium',], + }], + ], + }, + 'inputs': [ + 'tools/build/repack_locales.py', + '<!@pymod_do_main(repack_locales -i <(branding_flag) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(INTERMEDIATE_DIR) <(pseudo_locales))' + ], + 'outputs': [ + '<!@pymod_do_main(repack_locales -o -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(INTERMEDIATE_DIR) <(pseudo_locales))' + ], + 'action': [ + '<@(repack_locales_cmd)', + '<@(branding_flag)', + '-g', '<(grit_out_dir)', + '-s', '<(SHARED_INTERMEDIATE_DIR)', + '-x', '<(INTERMEDIATE_DIR)', + '<@(pseudo_locales)', + ], + }, + ], + # We'll install the resource files to the product directory. + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/locales', + 'files': [ + '<!@pymod_do_main(repack_locales -o -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(INTERMEDIATE_DIR) <(locales))' + ], + }, + { + 'destination': '<(PRODUCT_DIR)/pseudo_locales', + 'files': [ + '<!@pymod_do_main(repack_locales -o -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(INTERMEDIATE_DIR) <(pseudo_locales))' + ], + }, + { + 'destination': '<(PRODUCT_DIR)', + 'files': [ + '<(INTERMEDIATE_DIR)/repack/chrome.pak' + ], + }, + ], + 'conditions': [ + ['branding=="Chrome"', { + 'copies': [ + { + # This location is for the Windows and Linux builds. For + # Windows, the chrome.release file ensures that these files are + # copied into the installer. Note that we have a separate + # section in chrome_dll.gyp to copy these files for Mac, as it + # needs to be dropped inside the framework. + 'destination': '<(PRODUCT_DIR)/default_apps', + 'files': ['<@(default_apps_list)'] + }, + ], + }], + ], + }], # targets + }], # OS != "mac" ], # 'conditions' } |