Skip to content

Commit

Permalink
extensions: Combine extensions_pak with app_shell_pak
Browse files Browse the repository at this point in the history
Use the same .pak file for both app_shell and	
extensions_unittests by merging app_shell_pak into extensions_pak.

BUG=397250,394469
TEST=extensions_unittests and app_shell
R=jamescook@chromium.org
TBR=yoz@chromium.org

Review URL: https://codereview.chromium.org/418283006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286536 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tfarina@chromium.org committed Jul 30, 2014
1 parent ce49c9e commit 02b2c90
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 76 deletions.
2 changes: 1 addition & 1 deletion athena/resources/athena_resources.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'dependencies': [
'../../ash/ash_resources.gyp:ash_resources',
'../../content/content_resources.gyp:content_resources',
'../../extensions/shell/app_shell.gyp:app_shell_pak',
'../../extensions/extensions.gyp:extensions_shell_and_test_pak',
'../../third_party/WebKit/public/blink_resources.gyp:blink_resources',
'../../ui/chromeos/ui_chromeos.gyp:ui_chromeos_resources',
'../../ui/chromeos/ui_chromeos.gyp:ui_chromeos_strings',
Expand Down
40 changes: 31 additions & 9 deletions extensions/extensions.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -733,29 +733,51 @@
'msvs_disabled_warnings': [ 4267, ],
},
{
# TODO(jamescook): Use the same .pak file for both app_shell and
# extensions_unittests by creating an extensions_resources.pak file
# that can be used in both places. This will save build time.
# http://crbug.com/397250
'target_name': 'extensions_pak',
# The pak file generated by this target is intended to be shared by
# both shell and test targets. It was combined because it might help a
# little bit with build time by avoiding a repack step (one instead of
# two).
'target_name': 'extensions_shell_and_test_pak',
'type': 'none',
'dependencies': [
# Need extension related resources in common_resources.pak and
# renderer_resources_100_percent.pak
'../chrome/chrome_resources.gyp:chrome_resources',
# Need dev-tools related resources in shell_resources.pak and
# devtools_resources.pak.
'../content/browser/devtools/devtools_resources.gyp:devtools_resources',
'../content/content_resources.gyp:content_resources',
'../content/content_shell_and_tests.gyp:content_shell_resources',
'../ui/resources/ui_resources.gyp:ui_resources',
'../ui/strings/ui_strings.gyp:ui_strings',
'extensions_resources.gyp:extensions_resources',
'extensions_strings.gyp:extensions_strings',
'shell/app_shell_resources.gyp:app_shell_resources',
],
'actions': [
{
'action_name': 'repack_extensions_pak',
'action_name': 'repack_extensions_shell_and_test_pak',
'variables': {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.pak',
# TODO(jamescook): Extract the extension/app related resources
# from generated_resources_en-US.pak. http://crbug.com/397250
'<(SHARED_INTERMEDIATE_DIR)/chrome/generated_resources_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/chrome/renderer_resources_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/content/shell_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_renderer_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/shell/app_shell_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/strings/extensions_strings_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',
],
'pak_output': '<(PRODUCT_DIR)/extensions.pak',
'pak_output': '<(PRODUCT_DIR)/extensions_shell_and_test.pak',
},
'includes': [ '../build/repack_action.gypi' ],
},
Expand All @@ -780,9 +802,9 @@
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'extensions_common',
'extensions_pak',
'extensions_renderer',
'extensions_resources.gyp:extensions_resources',
'extensions_shell_and_test_pak',
'extensions_strings.gyp:extensions_strings',
'extensions_test_support',
],
Expand Down
7 changes: 4 additions & 3 deletions extensions/shell/app/shell_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ ShellMainDelegate::CreateShellRendererMainDelegate() {
}

void ShellMainDelegate::InitializeResourceBundle() {
base::FilePath pak_dir;
PathService::Get(base::DIR_MODULE, &pak_dir);
base::FilePath extensions_shell_and_test_pak_path;
PathService::Get(base::DIR_MODULE, &extensions_shell_and_test_pak_path);
ui::ResourceBundle::InitSharedInstanceWithPakPath(
pak_dir.AppendASCII("app_shell.pak"));
extensions_shell_and_test_pak_path.AppendASCII(
"extensions_shell_and_test.pak"));
}

// static
Expand Down
62 changes: 2 additions & 60 deletions extensions/shell/app_shell.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -7,70 +7,11 @@
'chromium_code': 1,
},
'targets': [
{
'target_name': 'app_shell_resources',
'type': 'none',
'actions': [
{
'action_name': 'generate_app_shell_resources',
'variables': {
'grit_grd_file': 'app_shell_resources.grd',
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/extensions/shell',
},
'includes': [ '../../build/grit_action.gypi' ],
},
],
},
{
'target_name': 'app_shell_pak',
'type': 'none',
'dependencies': [
'app_shell_resources',
# Need extension related resources in common_resources.pak and
# renderer_resources_100_percent.pak
'<(DEPTH)/chrome/chrome_resources.gyp:chrome_resources',
# Need dev-tools related resources in shell_resources.pak and
# devtools_resources.pak.
'<(DEPTH)/content/content_shell_and_tests.gyp:content_shell_resources',
'<(DEPTH)/content/browser/devtools/devtools_resources.gyp:devtools_resources',
'<(DEPTH)/extensions/extensions_resources.gyp:extensions_resources',
'<(DEPTH)/extensions/extensions_strings.gyp:extensions_strings',
'<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
'<(DEPTH)/ui/strings/ui_strings.gyp:ui_strings',
],
'actions': [
{
'action_name': 'repack_app_shell_pack',
'variables': {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.pak',
# TODO(jamescook): Extract the extension/app related resources
# from generated_resources_en-US.pak. http://crbug.com/397250
'<(SHARED_INTERMEDIATE_DIR)/chrome/generated_resources_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/chrome/renderer_resources_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/content/shell_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_renderer_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/shell/app_shell_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/extensions/strings/extensions_strings_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',
],
'pak_output': '<(PRODUCT_DIR)/app_shell.pak',
},
'includes': [ '../../build/repack_action.gypi' ],
},
],
},
{
'target_name': 'app_shell_lib',
'type': 'static_library',
'defines!': ['CONTENT_IMPLEMENTATION'],
'dependencies': [
'app_shell_pak',
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/base.gyp:base_prefs_test_support',
'<(DEPTH)/components/components.gyp:omaha_query_params',
Expand All @@ -85,6 +26,7 @@
'<(DEPTH)/extensions/extensions.gyp:extensions_browser',
'<(DEPTH)/extensions/extensions.gyp:extensions_common',
'<(DEPTH)/extensions/extensions.gyp:extensions_renderer',
'<(DEPTH)/extensions/extensions.gyp:extensions_shell_and_test_pak',
'<(DEPTH)/extensions/extensions_resources.gyp:extensions_resources',
'<(DEPTH)/extensions/shell/common/api/api.gyp:shell_api',
'<(DEPTH)/mojo/mojo.gyp:mojo_environment_chromium',
Expand Down Expand Up @@ -173,7 +115,7 @@
'defines!': ['CONTENT_IMPLEMENTATION'],
'dependencies': [
'app_shell_lib',
'app_shell_pak',
'<(DEPTH)/extensions/extensions.gyp:extensions_shell_and_test_pak',
],
'include_dirs': [
'../..',
Expand Down
25 changes: 25 additions & 0 deletions extensions/shell/app_shell_resources.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2014 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.

{
'targets': [
{
'target_name': 'app_shell_resources',
'type': 'none',
'variables': {
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/extensions/shell',
},
'actions': [
{
'action_name': 'generate_app_shell_resources',
'variables': {
'grit_grd_file': 'app_shell_resources.grd',
},
'includes': [ '../../build/grit_action.gypi' ],
},
],
'includes': [ '../../build/grit_target.gypi' ],
},
] # targets
}
7 changes: 4 additions & 3 deletions extensions/test/extensions_unittests_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ void ExtensionsTestSuite::Initialize() {

extensions::RegisterPathProvider();

base::FilePath extensions_pak_path;
PathService::Get(base::DIR_MODULE, &extensions_pak_path);
base::FilePath extensions_shell_and_test_pak_path;
PathService::Get(base::DIR_MODULE, &extensions_shell_and_test_pak_path);
ui::ResourceBundle::InitSharedInstanceWithPakPath(
extensions_pak_path.AppendASCII("extensions.pak"));
extensions_shell_and_test_pak_path.AppendASCII(
"extensions_shell_and_test.pak"));

client_.reset(new extensions::TestExtensionsClient());
extensions::ExtensionsClient::Set(client_.get());
Expand Down

0 comments on commit 02b2c90

Please sign in to comment.