Skip to content

Commit

Permalink
Work toward a chrome/common GN target.
Browse files Browse the repository at this point in the history
This adds more of the chrome/common target. The sources don't all compile yet so this is commented out.

Add many resources targets required my chrome/common.

R=thestig@chromium.org
TBR=thestig@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278586 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
brettw@chromium.org committed Jun 20, 2014
1 parent 89e4b74 commit 7f2b78e
Show file tree
Hide file tree
Showing 12 changed files with 236 additions and 55 deletions.
3 changes: 2 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ group("root") {

"//apps/common/api:apps_api",
"//cc",
"//chrome:resources",
"//chrome/common",
"//components/favicon_base",
"//components/language_usage_metrics",
"//components/metrics",
Expand Down Expand Up @@ -142,6 +142,7 @@ group("root") {
if (is_android) {
deps -= [
"//cc",
"//chrome/common", # Blocked on content.
"//content",
"//components/keyed_service/content", # Blocked on content.
"//components/user_prefs", # Blocked on content.
Expand Down
5 changes: 5 additions & 0 deletions build/gypi_to_gn.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ def LoadPythonDictionary(path):
if 'target_conditions' in file_data:
del file_data['target_conditions']

# Strip targets in the toplevel, since some files define these and we can't
# slurp them in.
if 'targets' in file_data:
del file_data['targets']

return file_data


Expand Down
10 changes: 10 additions & 0 deletions chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ group("resources") {
deps += [ "//chrome/common:extensions_api_resources" ]
}
}

# GYP version: chrome/chrome_resources.gyp:chrome_strings
group("strings") {
deps = [
"//chrome/app:chromium_strings",
"//chrome/app:generated_resources",
"//chrome/app:google_chrome_strings",
"//chrome/app/resources:locale_settings",
]
}
23 changes: 23 additions & 0 deletions chrome/app/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.

import("//tools/grit/grit_rule.gni")

# GYP version: chrome/chrome_resources.gyp:chrome_strings
# (generate_generated_resources action)
grit("generated_resources") {
source = "generated_resources.grd"
}

# GYP version: chrome/chrome_resources.gyp:chrome_strings
# (generate_google_chrome_strings action)
grit("google_chrome_strings") {
source = "google_chrome_strings.grd"
}

# GYP version: chrome/chrome_resources.gyp:chrome_strings
# (generate_chromium_strings action)
grit("chromium_strings") {
source = "chromium_strings.grd"
}
11 changes: 11 additions & 0 deletions chrome/app/resources/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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.

import("//tools/grit/grit_rule.gni")

# GYP version: chrome/chrome_resources.gyp:chrome_strings
# (generate_locale_settings action)
grit("locale_settings") {
source = "locale_settings.grd"
}
10 changes: 10 additions & 0 deletions chrome/app/theme/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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.

import("//tools/grit/grit_rule.gni")

# GYP version: chrome/chrome_resources.gyp:theme_resources
grit("theme_resources") {
source = "theme_resources.grd"
}
83 changes: 36 additions & 47 deletions chrome/chrome_common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -60,48 +60,18 @@
'common/custom_handlers/protocol_handler.cc',
'common/custom_handlers/protocol_handler.h',
'common/descriptors_android.h',
'common/extensions/api/bluetooth/bluetooth_manifest_data.cc',
'common/extensions/api/bluetooth/bluetooth_manifest_data.h',
'common/extensions/api/bluetooth/bluetooth_manifest_handler.cc',
'common/extensions/api/bluetooth/bluetooth_manifest_handler.h',
'common/extensions/api/bluetooth/bluetooth_manifest_permission.cc',
'common/extensions/api/bluetooth/bluetooth_manifest_permission.h',
'common/extensions/api/commands/commands_handler.cc',
'common/extensions/api/commands/commands_handler.h',
'common/extensions/api/extension_action/action_info.cc',
'common/extensions/api/extension_action/action_info.h',
'common/extensions/api/extension_action/browser_action_handler.cc',
'common/extensions/api/extension_action/browser_action_handler.h',
'common/extensions/api/extension_action/page_action_handler.cc',
'common/extensions/api/extension_action/page_action_handler.h',
'common/extensions/api/file_browser_handlers/file_browser_handler.cc',
'common/extensions/api/file_browser_handlers/file_browser_handler.h',
'common/extensions/api/i18n/default_locale_handler.cc',
'common/extensions/api/i18n/default_locale_handler.h',
'common/extensions/api/identity/oauth2_manifest_handler.cc',
'common/extensions/api/identity/oauth2_manifest_handler.h',
'common/extensions/api/input_ime/input_components_handler.cc',
'common/extensions/api/input_ime/input_components_handler.h',
'common/extensions/api/managed_mode_private/managed_mode_handler.cc',
'common/extensions/api/managed_mode_private/managed_mode_handler.h',
'common/extensions/api/notifications/notification_style.cc',
'common/extensions/api/notifications/notification_style.h',
'common/extensions/api/omnibox/omnibox_handler.cc',
'common/extensions/api/omnibox/omnibox_handler.h',
'common/extensions/api/plugins/plugins_handler.cc',
'common/extensions/api/plugins/plugins_handler.h',
'common/extensions/api/speech/tts_engine_manifest_handler.cc',
'common/extensions/api/speech/tts_engine_manifest_handler.h',
'common/extensions/api/spellcheck/spellcheck_handler.cc',
'common/extensions/api/spellcheck/spellcheck_handler.h',
'common/extensions/api/storage/storage_schema_manifest_handler.cc',
'common/extensions/api/storage/storage_schema_manifest_handler.h',
'common/extensions/api/system_indicator/system_indicator_handler.cc',
'common/extensions/api/system_indicator/system_indicator_handler.h',
'common/extensions/api/url_handlers/url_handlers_parser.cc',
'common/extensions/api/url_handlers/url_handlers_parser.h',
'common/extensions/api/webstore/webstore_api_constants.cc',
'common/extensions/api/webstore/webstore_api_constants.h',
'common/extensions/chrome_extension_messages.h',
'common/extensions/chrome_extensions_client.cc',
'common/extensions/chrome_extensions_client.h',
Expand Down Expand Up @@ -259,6 +229,38 @@
'common/worker_thread_ticker.cc',
'common/worker_thread_ticker.h',
],
'chrome_common_extensions_sources': [
'common/extensions/api/bluetooth/bluetooth_manifest_data.cc',
'common/extensions/api/bluetooth/bluetooth_manifest_data.h',
'common/extensions/api/bluetooth/bluetooth_manifest_handler.cc',
'common/extensions/api/bluetooth/bluetooth_manifest_handler.h',
'common/extensions/api/bluetooth/bluetooth_manifest_permission.cc',
'common/extensions/api/bluetooth/bluetooth_manifest_permission.h',
'common/extensions/api/commands/commands_handler.cc',
'common/extensions/api/commands/commands_handler.h',
'common/extensions/api/extension_action/browser_action_handler.cc',
'common/extensions/api/extension_action/browser_action_handler.h',
'common/extensions/api/extension_action/page_action_handler.cc',
'common/extensions/api/extension_action/page_action_handler.h',
'common/extensions/api/file_browser_handlers/file_browser_handler.cc',
'common/extensions/api/file_browser_handlers/file_browser_handler.h',
'common/extensions/api/input_ime/input_components_handler.cc',
'common/extensions/api/input_ime/input_components_handler.h',
'common/extensions/api/notifications/notification_style.cc',
'common/extensions/api/notifications/notification_style.h',
'common/extensions/api/omnibox/omnibox_handler.cc',
'common/extensions/api/omnibox/omnibox_handler.h',
'common/extensions/api/speech/tts_engine_manifest_handler.cc',
'common/extensions/api/speech/tts_engine_manifest_handler.h',
'common/extensions/api/spellcheck/spellcheck_handler.cc',
'common/extensions/api/spellcheck/spellcheck_handler.h',
'common/extensions/api/system_indicator/system_indicator_handler.cc',
'common/extensions/api/system_indicator/system_indicator_handler.h',
'common/extensions/api/url_handlers/url_handlers_parser.cc',
'common/extensions/api/url_handlers/url_handlers_parser.h',
'common/extensions/api/webstore/webstore_api_constants.cc',
'common/extensions/api/webstore/webstore_api_constants.h',
],
},
'targets': [
{
Expand Down Expand Up @@ -319,26 +321,13 @@
],
'conditions': [
['enable_extensions==1', {
'sources': [
'<@(chrome_common_extensions_sources)',
],
'dependencies': [
'../device/bluetooth/bluetooth.gyp:device_bluetooth',
'../device/usb/usb.gyp:device_usb',
],
}, { # enable_extensions == 0
'sources/': [
['exclude', '^common/extensions/api/'],
['include', 'common/extensions/api/extension_action/action_info.cc'],
['include', 'common/extensions/api/extension_action/action_info.h'],
['include', 'common/extensions/api/i18n/default_locale_handler.cc'],
['include', 'common/extensions/api/i18n/default_locale_handler.h'],
['include', 'common/extensions/api/identity/oauth2_manifest_handler.cc'],
['include', 'common/extensions/api/identity/oauth2_manifest_handler.h'],
['include', 'common/extensions/api/managed_mode_private/managed_mode_handler.cc'],
['include', 'common/extensions/api/managed_mode_private/managed_mode_handler.h'],
['include', 'common/extensions/api/plugins/plugins_handler.cc'],
['include', 'common/extensions/api/plugins/plugins_handler.h'],
['include', 'common/extensions/api/storage/storage_schema_manifest_handler.cc'],
['include', 'common/extensions/api/storage/storage_schema_manifest_handler.h'],
],
}],
['OS=="win" or OS=="mac"', {
'sources': [
Expand Down Expand Up @@ -585,7 +574,7 @@
],
},
{
# GN version: //chrome/commoon/net:net
# GN version: //chrome/common/net:net
'target_name': 'common_net',
'type': 'static_library',
'sources': [
Expand Down
9 changes: 8 additions & 1 deletion chrome/chrome_resources.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
# to run grit would list its own .grd files, but unfortunately some
# of the static libraries currently have circular dependencies among
# generated headers.

#
# GN version: //chrome:resources
'target_name': 'chrome_resources',
'type': 'none',
Expand Down Expand Up @@ -228,31 +228,37 @@
# to run grit would list its own .grd files, but unfortunately some
# of the static libraries currently have circular dependencies among
# generated headers.
#
# GN version: //chrome:strings
'target_name': 'chrome_strings',
'type': 'none',
'actions': [
{
# GN version: //chrome/app/resources:locale_settings
'action_name': 'generate_locale_settings',
'variables': {
'grit_grd_file': 'app/resources/locale_settings.grd',
},
'includes': [ '../build/grit_action.gypi' ],
},
{
# GN version: //chrome/app:chromium_strings
'action_name': 'generate_chromium_strings',
'variables': {
'grit_grd_file': 'app/chromium_strings.grd',
},
'includes': [ '../build/grit_action.gypi' ],
},
{
# GN version: //chrome/app:generated_resources
'action_name': 'generate_generated_resources',
'variables': {
'grit_grd_file': 'app/generated_resources.grd',
},
'includes': [ '../build/grit_action.gypi' ],
},
{
# GN version: //chrome/app:google_chrome_strings
'action_name': 'generate_google_chrome_strings',
'variables': {
'grit_grd_file': 'app/google_chrome_strings.grd',
Expand Down Expand Up @@ -334,6 +340,7 @@
'includes': [ '../build/grit_target.gypi' ],
},
{
# GN version: //chrome/app/theme:theme_resources
'target_name': 'theme_resources',
'type': 'none',
'dependencies': [
Expand Down
Loading

0 comments on commit 7f2b78e

Please sign in to comment.