Commit bc7510e8 authored by tc@google.com's avatar tc@google.com

Fix make build by making sure .pak files are listed as outputs of grd files.

Specifically:
1) In webkit.gyp and test_shell.gyp, convert the rules to actions because of different grd outputs (localized grd files have locale in the .pak filename).
2) In chrome, make two targets each with a custom rule.  One target is for localized resources, the other for non-localized resources.  This is like the current windows build.

Review URL: http://codereview.chromium.org/100174


git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15059 0039d316-1c4b-4281-b951-d872f2087c98
parent 2449703f
...@@ -26,7 +26,7 @@ deps = { ...@@ -26,7 +26,7 @@ deps = {
# TODO(mark): Remove once this has moved into depot_tools. # TODO(mark): Remove once this has moved into depot_tools.
"src/tools/gyp": "src/tools/gyp":
"http://gyp.googlecode.com/svn/trunk@457", "http://gyp.googlecode.com/svn/trunk@458",
"src/v8": "src/v8":
"http://v8.googlecode.com/svn/trunk@1809", "http://v8.googlecode.com/svn/trunk@1809",
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
# to run grit would list its own .grd files, but unfortunately some # to run grit would list its own .grd files, but unfortunately some
# of the static libraries currently have circular dependencies among # of the static libraries currently have circular dependencies among
# generated headers. # generated headers.
'target_name': 'resources', 'target_name': 'chrome_resources',
'type': 'none', 'type': 'none',
'rules': [ 'rules': [
{ {
...@@ -53,18 +53,15 @@ ...@@ -53,18 +53,15 @@
], ],
'outputs': [ 'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/chrome/grit/<(RULE_INPUT_ROOT).h', '<(SHARED_INTERMEDIATE_DIR)/chrome/grit/<(RULE_INPUT_ROOT).h',
'<(SHARED_INTERMEDIATE_DIR)/chrome/<(RULE_INPUT_ROOT).pak',
], ],
'action': ['python', '<@(_inputs)', '-i', '<(RULE_INPUT_PATH)', 'build', '-o', '<(SHARED_INTERMEDIATE_DIR)/chrome'], 'action': ['python', '<@(_inputs)', '-i', '<(RULE_INPUT_PATH)', 'build', '-o', '<(SHARED_INTERMEDIATE_DIR)/chrome'],
'message': 'Generating resources from <(RULE_INPUT_PATH)', 'message': 'Generating resources from <(RULE_INPUT_PATH)',
}, },
], ],
'sources': [ 'sources': [
# All .grd files under chrome. # Data resources.
'app/resources/locale_settings.grd',
'app/theme/theme_resources.grd', 'app/theme/theme_resources.grd',
'app/chromium_strings.grd',
'app/generated_resources.grd',
'app/google_chrome_strings.grd',
'browser/debugger/resources/debugger_resources.grd', 'browser/debugger/resources/debugger_resources.grd',
'browser/browser_resources.grd', 'browser/browser_resources.grd',
'common/common_resources.grd', 'common/common_resources.grd',
...@@ -76,11 +73,47 @@ ...@@ -76,11 +73,47 @@
], ],
}, },
}, },
{
# 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',
'rules': [
{
'rule_name': 'grit',
'extension': 'grd',
'inputs': [
'../tools/grit/grit.py',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/chrome/grit/<(RULE_INPUT_ROOT).h',
'<(SHARED_INTERMEDIATE_DIR)/chrome/<(RULE_INPUT_ROOT)_en-US.pak',
],
'action': ['python', '<@(_inputs)', '-i', '<(RULE_INPUT_PATH)', 'build', '-o', '<(SHARED_INTERMEDIATE_DIR)/chrome'],
'message': 'Generating resources from <(RULE_INPUT_PATH)',
},
],
'sources': [
# Localizable resources.
'app/resources/locale_settings.grd',
'app/chromium_strings.grd',
'app/generated_resources.grd',
'app/google_chrome_strings.grd',
],
'direct_dependent_settings': {
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)/chrome',
],
},
},
{ {
'target_name': 'common', 'target_name': 'common',
'type': '<(library)', 'type': '<(library)',
'dependencies': [ 'dependencies': [
'resources', 'chrome_resources',
'chrome_strings',
'../base/base.gyp:base', '../base/base.gyp:base',
'../base/base.gyp:base_gfx', '../base/base.gyp:base_gfx',
'../build/temp_gyp/googleurl.gyp:googleurl', '../build/temp_gyp/googleurl.gyp:googleurl',
...@@ -361,7 +394,8 @@ ...@@ -361,7 +394,8 @@
'type': '<(library)', 'type': '<(library)',
'dependencies': [ 'dependencies': [
'common', 'common',
'resources', 'chrome_resources',
'chrome_strings',
'../media/media.gyp:media', '../media/media.gyp:media',
'../net/net.gyp:net_resources', '../net/net.gyp:net_resources',
'../skia/skia.gyp:skia', '../skia/skia.gyp:skia',
...@@ -1477,7 +1511,8 @@ ...@@ -1477,7 +1511,8 @@
'type': '<(library)', 'type': '<(library)',
'dependencies': [ 'dependencies': [
'common', 'common',
'resources', 'chrome_resources',
'chrome_strings',
'../media/media.gyp:media', '../media/media.gyp:media',
'../skia/skia.gyp:skia', '../skia/skia.gyp:skia',
'../third_party/icu38/icu38.gyp:icui18n', '../third_party/icu38/icu38.gyp:icui18n',
...@@ -1534,7 +1569,8 @@ ...@@ -1534,7 +1569,8 @@
'dependencies': [ 'dependencies': [
'common', 'common',
'plugin', 'plugin',
'resources', 'chrome_resources',
'chrome_strings',
'../printing/printing.gyp:printing', '../printing/printing.gyp:printing',
'../skia/skia.gyp:skia', '../skia/skia.gyp:skia',
'../third_party/icu38/icu38.gyp:icui18n', '../third_party/icu38/icu38.gyp:icui18n',
...@@ -1913,7 +1949,8 @@ ...@@ -1913,7 +1949,8 @@
'browser', 'browser',
'common', 'common',
'renderer', 'renderer',
'resources', 'chrome_resources',
'chrome_strings',
'../skia/skia.gyp:skia', '../skia/skia.gyp:skia',
'../testing/gtest.gyp:gtest', '../testing/gtest.gyp:gtest',
], ],
...@@ -1992,7 +2029,8 @@ ...@@ -1992,7 +2029,8 @@
'type': '<(library)', 'type': '<(library)',
'dependencies': [ 'dependencies': [
'test_support_common', 'test_support_common',
'resources', 'chrome_resources',
'chrome_strings',
'../skia/skia.gyp:skia', '../skia/skia.gyp:skia',
'../testing/gtest.gyp:gtest', '../testing/gtest.gyp:gtest',
], ],
...@@ -2027,7 +2065,8 @@ ...@@ -2027,7 +2065,8 @@
'type': '<(library)', 'type': '<(library)',
'dependencies': [ 'dependencies': [
'test_support_common', 'test_support_common',
'resources', 'chrome_resources',
'chrome_strings',
'../skia/skia.gyp:skia', '../skia/skia.gyp:skia',
'../testing/gtest.gyp:gtest', '../testing/gtest.gyp:gtest',
], ],
...@@ -2080,7 +2119,8 @@ ...@@ -2080,7 +2119,8 @@
'app', 'app',
'browser', 'browser',
'common', 'common',
'resources', 'chrome_resources',
'chrome_strings',
'test_support_ui', 'test_support_ui',
'../base/base.gyp:base', '../base/base.gyp:base',
'../net/net.gyp:net', '../net/net.gyp:net',
...@@ -2226,7 +2266,8 @@ ...@@ -2226,7 +2266,8 @@
'browser', 'browser',
'common', 'common',
'renderer', 'renderer',
'resources', 'chrome_resources',
'chrome_strings',
'test_support_unit', 'test_support_unit',
'../printing/printing.gyp:printing', '../printing/printing.gyp:printing',
'../webkit/webkit.gyp:webkit', '../webkit/webkit.gyp:webkit',
...@@ -2534,7 +2575,8 @@ ...@@ -2534,7 +2575,8 @@
'app', 'app',
'browser', 'browser',
'common', 'common',
'resources', 'chrome_resources',
'chrome_strings',
'test_support_ui', 'test_support_ui',
'../base/base.gyp:base', '../base/base.gyp:base',
'../skia/skia.gyp:skia', '../skia/skia.gyp:skia',
...@@ -2564,7 +2606,8 @@ ...@@ -2564,7 +2606,8 @@
'target_name': 'page_cycler_tests', 'target_name': 'page_cycler_tests',
'type': 'executable', 'type': 'executable',
'dependencies': [ 'dependencies': [
'resources', 'chrome_resources',
'chrome_strings',
'test_support_ui', 'test_support_ui',
'../base/base.gyp:base', '../base/base.gyp:base',
'../skia/skia.gyp:skia', '../skia/skia.gyp:skia',
...@@ -2660,7 +2703,8 @@ ...@@ -2660,7 +2703,8 @@
'browser', 'browser',
'common', 'common',
'renderer', 'renderer',
'resources', 'chrome_resources',
'chrome_strings',
'../base/base.gyp:base', '../base/base.gyp:base',
'../base/base.gyp:test_support_base', '../base/base.gyp:test_support_base',
'../skia/skia.gyp:skia', '../skia/skia.gyp:skia',
...@@ -2698,7 +2742,8 @@ ...@@ -2698,7 +2742,8 @@
'type': '<(library)', 'type': '<(library)',
'dependencies': [ 'dependencies': [
'common', 'common',
'resources', 'chrome_resources',
'chrome_strings',
'../media/media.gyp:media', '../media/media.gyp:media',
'../skia/skia.gyp:skia', '../skia/skia.gyp:skia',
'../third_party/icu38/icu38.gyp:icui18n', '../third_party/icu38/icu38.gyp:icui18n',
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
'dependencies': [ 'dependencies': [
'prebuild/util_prebuild.gyp:installer_util_prebuild', 'prebuild/util_prebuild.gyp:installer_util_prebuild',
'../../chrome.gyp:common', '../../chrome.gyp:common',
'../../chrome.gyp:resources', '../../chrome.gyp:chrome_resources',
'../../chrome.gyp:chrome_strings',
'../../../net/net.gyp:net_resources', '../../../net/net.gyp:net_resources',
'../../../media/media.gyp:media', '../../../media/media.gyp:media',
'../../../skia/skia.gyp:skia', '../../../skia/skia.gyp:skia',
......
...@@ -187,7 +187,8 @@ ...@@ -187,7 +187,8 @@
'dependencies': [ 'dependencies': [
'../../../build/linux/system.gyp:gtk', '../../../build/linux/system.gyp:gtk',
'../../../net/net.gyp:net_resources', '../../../net/net.gyp:net_resources',
'../../webkit.gyp:glue', # for webkit_{resources,strings_en-US}.pak '../../webkit.gyp:webkit_resources',
'../../webkit.gyp:webkit_strings',
'test_shell_resources', 'test_shell_resources',
], ],
'actions': [ 'actions': [
...@@ -459,25 +460,23 @@ ...@@ -459,25 +460,23 @@
{ {
'target_name': 'test_shell_resources', 'target_name': 'test_shell_resources',
'type': 'none', 'type': 'none',
'sources': [ 'actions': [
'test_shell_resources.grd',
],
# This was orignally in grit_resources.rules
# NOTE: this version doesn't mimic the Properties specified there.
'rules': [
{ {
'rule_name': 'grit', 'action_name': 'test_shell_resources',
'extension': 'grd', 'variables': {
'grit_path': '../../../tools/grit/grit.py',
'input_path': './test_shell_resources.grd',
'out_dir': '<(SHARED_INTERMEDIATE_DIR)/test_shell',
},
'inputs': [ 'inputs': [
'../../../tools/grit/grit.py', '<(input_path)',
], ],
'outputs': [ 'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/test_shell/grit/<(RULE_INPUT_ROOT).h', '<(out_dir)/grit/test_shell_resources.h',
'<(SHARED_INTERMEDIATE_DIR)/test_shell/<(RULE_INPUT_ROOT).pak', '<(out_dir)/test_shell_resources.pak',
], ],
'action': 'action': ['python', '<(grit_path)', '-i', '<(input_path)', 'build', '-o', '<(out_dir)'],
['python', '<@(_inputs)', '-i', '<(RULE_INPUT_PATH)', 'build', '-o', '<(SHARED_INTERMEDIATE_DIR)/test_shell'], 'message': 'Generating resources from <(input_path)',
'message': 'Generating resources from <(RULE_INPUT_PATH)',
}, },
], ],
'direct_dependent_settings': { 'direct_dependent_settings': {
......
...@@ -4251,28 +4251,59 @@ ...@@ -4251,28 +4251,59 @@
'target_name': 'webkit_resources', 'target_name': 'webkit_resources',
'type': 'none', 'type': 'none',
'msvs_guid': '0B469837-3D46-484A-AFB3-C5A6C68730B9', 'msvs_guid': '0B469837-3D46-484A-AFB3-C5A6C68730B9',
'dependencies': [ 'variables': {
'webcore', 'grit_path': '../tools/grit/grit.py',
'webkit', 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/webkit',
'../net/net.gyp:net', },
], 'actions': [
'rules': [
{ {
'rule_name': 'grit', 'action_name': 'webkit_resources',
'extension': 'grd', 'variables': {
'input_path': 'glue/webkit_resources.grd',
},
'inputs': [ 'inputs': [
'../tools/grit/grit.py', '<(input_path)',
], ],
'outputs': [ 'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/webkit/grit/<(RULE_INPUT_ROOT).h', '<(grit_out_dir)/grit/webkit_resources.h',
'<(grit_out_dir)/webkit_resources.pak',
'<(grit_out_dir)/webkit_resources.rc',
], ],
'action': ['python', '<@(_inputs)', '-i', '<(RULE_INPUT_PATH)', 'build', '-o', '<(SHARED_INTERMEDIATE_DIR)/webkit'], 'action': ['python', '<(grit_path)', '-i', '<(input_path)', 'build', '-o', '<(grit_out_dir)'],
'message': 'Generating resources from <(input_path)',
}, },
], ],
'sources': [ 'direct_dependent_settings': {
# grit rule 'include_dirs': [
'glue/webkit_resources.grd', '<(SHARED_INTERMEDIATE_DIR)/webkit',
'glue/webkit_strings.grd', ],
},
},
{
'target_name': 'webkit_strings',
'type': 'none',
'msvs_guid': '60B43839-95E6-4526-A661-209F16335E0E',
'variables': {
'grit_path': '../tools/grit/grit.py',
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/webkit',
},
'actions': [
{
'action_name': 'webkit_strings',
'variables': {
'input_path': 'glue/webkit_strings.grd',
},
'inputs': [
'<(input_path)',
],
'outputs': [
'<(grit_out_dir)/grit/webkit_strings.h',
'<(grit_out_dir)/webkit_strings_en-US.pak',
'<(grit_out_dir)/webkit_strings_en-US.rc',
],
'action': ['python', '<(grit_path)', '-i', '<(input_path)', 'build', '-o', '<(grit_out_dir)'],
'message': 'Generating resources from <(input_path)',
},
], ],
'direct_dependent_settings': { 'direct_dependent_settings': {
'include_dirs': [ 'include_dirs': [
...@@ -4289,6 +4320,7 @@ ...@@ -4289,6 +4320,7 @@
'webkit', 'webkit',
'../net/net.gyp:net', '../net/net.gyp:net',
'webkit_resources', 'webkit_resources',
'webkit_strings',
], ],
'actions': [ 'actions': [
{ {
...@@ -4479,8 +4511,8 @@ ...@@ -4479,8 +4511,8 @@
'glue/webmediaplayer_delegate.h', 'glue/webmediaplayer_delegate.h',
'glue/webmediaplayer_impl.cc', 'glue/webmediaplayer_impl.cc',
'glue/webmediaplayer_impl.h', 'glue/webmediaplayer_impl.h',
'glue/webmenurunner_mac.h', 'glue/webmenurunner_mac.h',
'glue/webmenurunner_mac.mm', 'glue/webmenurunner_mac.mm',
'glue/webplugin.h', 'glue/webplugin.h',
'glue/webplugin_delegate.cc', 'glue/webplugin_delegate.cc',
'glue/webplugin_delegate.h', 'glue/webplugin_delegate.h',
......
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