Skip to content

Commit

Permalink
Clean up app_shell GN build.
Browse files Browse the repository at this point in the history
This unifies sources lists between GYP and GN
builds and gets app_shell_unittests building
on GN in most environments.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#316312}
  • Loading branch information
krockot authored and Commit bot committed Feb 13, 2015
1 parent 82bfff9 commit 466cf20
Show file tree
Hide file tree
Showing 5 changed files with 273 additions and 206 deletions.
3 changes: 2 additions & 1 deletion extensions/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ source_set("test_support") {
deps = [
":extensions_resources",
"//base",
"//content/public/browser",
"//base:prefs_test_support",
"//content/public/common",
"//content/test:test_support",
"//extensions/browser",
Expand All @@ -87,6 +87,7 @@ source_set("test_support") {
]

public_deps = [
"//content/public/browser",
"//extensions/common/api/cast_channel:cast_channel_proto",
]

Expand Down
197 changes: 103 additions & 94 deletions extensions/shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//extensions/shell/app_shell.gni")

# Technically, this directory should not depend on files from src/chrome, but
# that's where the VERSION file is. This should probably all be moved to
# src/build.
import("//chrome/version.gni")
import("//testing/test.gni")
import("//tools/grit/grit_rule.gni")

assert(enable_extensions)
Expand Down Expand Up @@ -52,115 +55,65 @@ source_set("app_shell_lib") {
"//third_party/mojo/src/mojo/edk/system",
"//ui/base",
"//ui/base/ime",
"//ui/wm",
"//v8",
]
sources = [
"app/shell_main_delegate.cc",
"app/shell_main_delegate.h",
"browser/api/identity/identity_api.cc",
"browser/api/identity/identity_api.h",
"browser/default_shell_browser_main_delegate.cc",
"browser/default_shell_browser_main_delegate.h",
"browser/desktop_controller.cc",
"browser/desktop_controller.h",
"browser/media_capture_util.cc",
"browser/media_capture_util.h",
"browser/shell_app_delegate.cc",
"browser/shell_app_delegate.h",
"browser/shell_app_view_guest_delegate.cc",
"browser/shell_app_view_guest_delegate.h",
"browser/shell_app_window_client.cc",
"browser/shell_app_window_client.h",
"browser/shell_app_window_client_aura.cc",
"browser/shell_audio_controller_chromeos.cc",
"browser/shell_audio_controller_chromeos.h",
"browser/shell_browser_context.cc",
"browser/shell_browser_context.h",
"browser/shell_browser_context_keyed_service_factories.cc",
"browser/shell_browser_context_keyed_service_factories.h",
"browser/shell_browser_main_delegate.h",
"browser/shell_browser_main_parts.cc",
"browser/shell_browser_main_parts.h",
"browser/shell_content_browser_client.cc",
"browser/shell_content_browser_client.h",
"browser/shell_desktop_controller_aura.cc",
"browser/shell_desktop_controller_aura.h",
"browser/shell_device_client.cc",
"browser/shell_device_client.h",
"browser/shell_display_info_provider.cc",
"browser/shell_display_info_provider.h",
"browser/shell_extension_host_delegate.cc",
"browser/shell_extension_host_delegate.h",
"browser/shell_extension_system.cc",
"browser/shell_extension_system.h",
"browser/shell_extension_system_factory.cc",
"browser/shell_extension_system_factory.h",
"browser/shell_extension_web_contents_observer.cc",
"browser/shell_extension_web_contents_observer.h",
"browser/shell_extensions_api_client.cc",
"browser/shell_extensions_api_client.h",
"browser/shell_extensions_browser_client.cc",
"browser/shell_extensions_browser_client.h",
"browser/shell_native_app_window.cc",
"browser/shell_native_app_window.h",
"browser/shell_native_app_window_aura.cc",
"browser/shell_native_app_window_aura.h",
"browser/shell_network_controller_chromeos.cc",
"browser/shell_network_controller_chromeos.h",
"browser/shell_network_delegate.cc",
"browser/shell_network_delegate.h",
"browser/shell_oauth2_token_service.cc",
"browser/shell_oauth2_token_service.h",
"browser/shell_prefs.cc",
"browser/shell_prefs.h",
"browser/shell_runtime_api_delegate.cc",
"browser/shell_runtime_api_delegate.h",
"browser/shell_screen.cc",
"browser/shell_screen.h",
"browser/shell_special_storage_policy.cc",
"browser/shell_special_storage_policy.h",
"browser/shell_speech_recognition_manager_delegate.cc",
"browser/shell_speech_recognition_manager_delegate.h",
"browser/shell_update_query_params_delegate.cc",
"browser/shell_update_query_params_delegate.h",
"browser/shell_url_request_context_getter.cc",
"browser/shell_url_request_context_getter.h",
"browser/shell_web_contents_modal_dialog_manager.cc",
"common/shell_content_client.cc",
"common/shell_content_client.h",
"common/shell_extensions_client.cc",
"common/shell_extensions_client.h",
"common/switches.cc",
"common/switches.h",
"renderer/shell_content_renderer_client.cc",
"renderer/shell_content_renderer_client.h",
"renderer/shell_extensions_renderer_client.cc",
"renderer/shell_extensions_renderer_client.h",
"utility/shell_content_utility_client.cc",
"utility/shell_content_utility_client.h",
]

sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources,
".",
"//extensions/shell")

if (use_aura) {
deps += [ "//ui/wm" ]

aura_sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources_aura,
".",
"//extensions/shell")
sources += aura_sources
}

if (is_chromeos) {
deps += [
"//chromeos",
"//ui/chromeos:ui_chromeos",
"//ui/display",
]
sources += [
"browser/api/shell_gcd/shell_gcd_api.cc",
"browser/api/shell_gcd/shell_gcd_api.h",
"browser/api/vpn_provider/vpn_service_factory.cc",
]
chromeos_sources =
rebase_path(app_shell_gypi_values.app_shell_lib_sources_chromeos,
".",
"//extensions/shell")
sources += chromeos_sources
}

# TODO(GYP): Enable this when //components/nacl GN is done. See
# http://crbug.com/430602
if (false) {
if (enable_nacl) {
if (is_linux) {
deps += [ "//components/nacl:nacl_helper" ]
}
deps += [
"//components/nacl",
"//components/nacl:browser",
"//components/nacl:common",
"//components/nacl:renderer",
"//components/nacl:switches",
]
nacl_sources =
rebase_path(app_shell_gypi_values.app_shell_lib_sources_nacl,
".",
"//extensions/shell")
sources += nacl_sources
}
}
}

if (!(is_chromeos && !use_ozone) && (!is_win || link_chrome_on_windows)) {
executable("app_shell") {
# testonly because :app_shell_lib is testonly. See :app_shell_lib comment.
testonly = true
sources = [
"app/shell_main.cc",
]
sources = rebase_path(app_shell_gypi_values.app_shell_sources,
".",
"//extensions/shell")
deps = [
":app_shell_lib",
"//extensions:shell_and_test_pak",
Expand All @@ -169,10 +122,66 @@ if (!(is_chromeos && !use_ozone) && (!is_win || link_chrome_on_windows)) {
if (is_win) {
configs += [ "//build/config/win:windowed" ]
configs -= [ "//build/config/win:console" ]
deps += [ "//base/allocator" ]
}

if (is_mac) {
# TODO(GYP): Mac bundling
}
}
}

test("app_shell_unittests") {
sources = rebase_path(app_shell_gypi_values.app_shell_unittests_sources,
".",
"//extensions/shell")

deps = [
":app_shell_lib",
"//base",
"//base/test:test_support",
"//content/test:test_support",
"//extensions:shell_and_test_pak",
"//extensions:test_support",
"//testing/gtest",
]

if (use_aura) {
deps += [ "//ui/aura:test_support" ]

aura_sources =
rebase_path(app_shell_gypi_values.app_shell_unittests_sources_aura,
".",
"//extensions/shell")
sources += aura_sources
}

if (is_chromeos) {
deps += [ "//chromeos:test_support_without_gmock" ]

chromeos_sources =
rebase_path(app_shell_gypi_values.app_shell_unittests_sources_chromeos,
".",
"//extensions/shell")
sources += chromeos_sources
}

# TODO(GYP): Enable this when //components/nacl GN is done.
if (false) {
if (use_nacl) {
nacl_sources =
rebase_path(app_shell_gypi_values.app_shell_unittests_sources_nacl,
".",
"//extensions/shell")
sources += nacl_sources
}
}

if (is_win) {
deps += [ "//base/allocator" ]
}
}

process_version("version_header") {
source = "common/version.h.in"
output = "$target_gen_dir/common/version.h"
Expand Down
16 changes: 16 additions & 0 deletions extensions/shell/app_shell.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2015 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.

# This file defines the app_shell gypi values. This file is read once and
# cached, which is a performance optimization that allows us to share the
# results of parsing the .gypi file between all app_shell BUILD.gn files.
# It also saves us from duplicating this exec_script call.
app_shell_gypi_values =
exec_script("//build/gypi_to_gn.py",
[
rebase_path("app_shell.gypi"),
"--replace=<(SHARED_INTERMEDIATE_DIR)=$root_gen_dir",
],
"scope",
[ "app_shell.gypi" ])
Loading

0 comments on commit 466cf20

Please sign in to comment.