naiveproxy/extensions/shell/BUILD.gn

496 lines
14 KiB
Plaintext
Raw Permalink Normal View History

2018-01-28 21:32:06 +03:00
# 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("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/util/process_version.gni")
import("//components/nacl/features.gni")
import("//extensions/features/features.gni")
import("//testing/test.gni")
import("//tools/grit/grit_rule.gni")
if (is_mac) {
import("//build/config/mac/rules.gni")
import("//third_party/icu/config.gni")
import("//v8/gni/v8.gni")
}
assert(enable_extensions)
grit("resources") {
source = "app_shell_resources.grd"
outputs = [
"grit/app_shell_resources.h",
"app_shell_resources.pak",
]
}
source_set("app_shell_lib") {
# TODO(jamescook): investigate and get rid of test dependencies. This library
# is testonly because it depends on testonly libraries, namely
# //content/shell:content_shell_lib. See http://crbug.com/438283
testonly = true
deps = [
":resources",
":version_header",
"//apps",
"//base",
"//components/feedback",
"//components/guest_view/browser",
"//components/guest_view/common",
"//components/guest_view/renderer",
"//components/nacl/common:features",
"//components/network_session_configurator/common",
"//components/pref_registry",
"//components/prefs",
"//components/update_client",
"//components/user_prefs",
"//components/web_cache/renderer",
"//content",
"//content/shell:content_shell_lib",
"//device/base",
"//device/bluetooth",
"//extensions:extensions_resources",
"//extensions:shell_and_test_pak",
"//extensions/browser",
"//extensions/browser/api:api_registration",
"//extensions/browser/kiosk",
"//extensions/common",
"//extensions/common/api",
"//extensions/renderer",
"//extensions/shell/browser/system_logs",
"//extensions/shell/common/api",
"//extensions/shell/common/api:api_registration",
"//extensions/shell/common/api:extensions_features",
"//extensions/utility",
"//skia",
"//third_party/WebKit/public:blink",
"//third_party/cld_3/src/src:cld_3",
"//ui/base",
"//ui/base/ime",
"//v8",
]
# TODO(michaelpg): remove Mac support and always use aura.
if (use_aura) {
deps += [
"//ui/aura",
"//ui/views",
]
if (use_x11) {
deps += [ "//ui/events" ]
}
}
sources = [
"app/paths_mac.h",
"app/paths_mac.mm",
"app/shell_main_delegate.cc",
"app/shell_main_delegate.h",
"browser/api/feedback_private/shell_feedback_private_delegate.cc",
"browser/api/feedback_private/shell_feedback_private_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/delegates/shell_kiosk_delegate.cc",
"browser/delegates/shell_kiosk_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_mac.mm",
"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_browser_main_parts_mac.h",
"browser/shell_browser_main_parts_mac.mm",
"browser/shell_content_browser_client.cc",
"browser/shell_content_browser_client.h",
"browser/shell_desktop_controller_mac.h",
"browser/shell_desktop_controller_mac.mm",
"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_mac.h",
"browser/shell_native_app_window_mac.mm",
"browser/shell_navigation_ui_data.cc",
"browser/shell_navigation_ui_data.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_oauth2_token_service_delegate.cc",
"browser/shell_oauth2_token_service_delegate.h",
"browser/shell_prefs.cc",
"browser/shell_prefs.h",
"browser/shell_runtime_api_delegate.cc",
"browser/shell_runtime_api_delegate.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_virtual_keyboard_delegate.cc",
"browser/shell_virtual_keyboard_delegate.h",
"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",
]
if (use_aura) {
sources += [
"browser/root_window_controller.cc",
"browser/root_window_controller.h",
"browser/shell_app_window_client_aura.cc",
"browser/shell_desktop_controller_aura.cc",
"browser/shell_desktop_controller_aura.h",
"browser/shell_native_app_window_aura.cc",
"browser/shell_native_app_window_aura.h",
]
deps += [
"//ui/wm",
"//ui/wm/public",
]
}
if (is_desktop_linux) {
sources += [
"browser/api/file_system/shell_file_system_delegate.cc",
"browser/api/file_system/shell_file_system_delegate.h",
]
}
if (is_chromeos) {
sources += [
"browser/api/vpn_provider/vpn_service_factory.cc",
"browser/api/vpn_provider/vpn_service_factory.h",
"browser/shell_screen.cc",
"browser/shell_screen.h",
]
deps += [
"//chromeos",
"//ui/chromeos",
"//ui/display/manager",
]
}
if (enable_nacl) {
sources += [
"browser/shell_nacl_browser_delegate.cc",
"browser/shell_nacl_browser_delegate.h",
]
deps += [
"//components/nacl/browser",
"//components/nacl/common",
"//components/nacl/loader",
"//components/nacl/renderer",
"//components/nacl/renderer/plugin:nacl_trusted_plugin",
]
if (is_linux) {
deps += [ "//components/nacl/loader:nacl_helper" ]
if (enable_nacl_nonsfi) {
deps += [ "//components/nacl/loader:helper_nonsfi" ]
}
}
}
}
if (is_mac) {
mac_app_bundle("app_shell") {
testonly = true
output_name = "App Shell"
sources = [
"app/shell_main.cc",
]
deps = [
":app_shell_framework_bundle_data",
"//build/config:exe_and_shlib_deps",
"//extensions:shell_and_test_pak",
]
ldflags = [
"-rpath",
"@executable_path/../",
]
info_plist = "app/app-Info.plist"
}
} else {
executable("app_shell") {
# testonly because :app_shell_lib is testonly. See :app_shell_lib comment.
testonly = true
sources = [
"app/shell_main.cc",
]
deps = [
":app_shell_lib",
"//build/config:exe_and_shlib_deps",
"//build/win:default_exe_manifest",
"//extensions:shell_and_test_pak",
]
if (is_win) {
configs += [ "//build/config/win:windowed" ]
configs -= [ "//build/config/win:console" ]
}
}
}
test("app_shell_unittests") {
sources = [
"../test/extensions_unittests_main.cc",
"browser/api/identity/identity_api_unittest.cc",
"browser/shell_oauth2_token_service_unittest.cc",
"browser/shell_prefs_unittest.cc",
"browser/system_logs/shell_system_logs_fetcher_unittest.cc",
"common/shell_content_client_unittest.cc",
"test/shell_test_extensions_browser_client.cc",
"test/shell_test_extensions_browser_client.h",
]
data = [
"//extensions/test/data/",
"$root_out_dir/extensions_shell_and_test.pak",
#"$root_out_dir/natives_blob.bin", # move to gin
#"$root_out_dir/snapshot_blob.bin",
]
deps = [
":app_shell_lib",
"//base",
"//base/test:test_support",
"//components/feedback",
"//content/test:test_support",
"//extensions:shell_and_test_pak",
"//extensions:test_support",
"//extensions/browser",
"//extensions/common",
"//testing/gtest",
]
data_deps = [
# "//gin", # TODO(dpranke): Either gin or v8 data is needed ...
"//third_party/mesa:osmesa",
]
if (use_aura) {
sources += [
"browser/root_window_controller_unittest.cc",
"browser/shell_desktop_controller_aura_unittest.cc",
"browser/shell_native_app_window_aura_unittest.cc",
"test/shell_test_base_aura.cc",
"test/shell_test_base_aura.h",
"test/shell_test_helper_aura.cc",
"test/shell_test_helper_aura.h",
]
deps += [
"//ui/aura:test_support",
"//ui/base:test_support",
"//ui/compositor:test_support",
]
}
if (is_chromeos) {
sources += [
"browser/shell_audio_controller_chromeos_unittest.cc",
"browser/shell_screen_unittest.cc",
]
deps += [ "//chromeos:test_support_without_gmock" ]
}
if (enable_nacl) {
sources += [ "browser/shell_nacl_browser_delegate_unittest.cc" ]
}
}
process_version("version_header") {
template_file = "common/version.h.in"
sources = [
"//build/util/LASTCHANGE",
"//chrome/VERSION",
]
output = "$target_gen_dir/common/version.h"
}
if (is_mac) {
bundle_data("app_shell_framework_resources") {
sources = [
"$root_gen_dir/extensions/shell/app_shell_resources.pak",
"$root_out_dir/extensions_shell_and_test.pak",
"$root_out_dir/v8_context_snapshot.bin",
]
public_deps = [
":resources_grit",
"//extensions:shell_and_test_pak",
"//tools/v8_context_snapshot:v8_context_snapshot",
]
if (icu_use_data_file) {
sources += [ "$root_out_dir/icudtl.dat" ]
public_deps += [ "//third_party/icu:icudata" ]
}
if (v8_use_external_startup_data) {
sources += [
"$root_out_dir/natives_blob.bin",
"$root_out_dir/snapshot_blob.bin",
]
public_deps += [ "//v8" ]
}
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
]
}
mac_framework_bundle("app_shell_framework") {
testonly = true
output_name = "App Shell Framework"
sources = [
"app/shell_main_mac.cc",
"app/shell_main_mac.h",
]
public_deps = [
":app_shell_lib",
]
deps = [
":app_shell_framework_resources",
]
ldflags = [ "-Wl,-install_name,@rpath/Frameworks/App Shell Framework.framework/App Shell Framework" ]
if (is_component_build) {
ldflags += [
"-rpath",
"@loader_path/../../../..",
]
}
info_plist = "app/framework-Info.plist"
}
mac_app_bundle("app_shell_helper_app") {
testonly = true
output_name = "App Shell Helper"
sources = [
"app/shell_main.cc",
]
deps = [
":app_shell_framework+link",
"//build/config:exe_and_shlib_deps",
]
ldflags = [
"-rpath",
"@executable_path/../../../..",
]
info_plist = "app/helper-Info.plist"
}
bundle_data("app_shell_framework_bundle_data") {
testonly = true
sources = [
"$root_out_dir/App Shell Framework.framework",
"$root_out_dir/App Shell Helper.app",
]
outputs = [
"{{bundle_contents_dir}}/Frameworks/{{source_file_part}}",
]
public_deps = [
":app_shell_framework+link",
":app_shell_helper_app",
]
}
}
source_set("browser_tests") {
testonly = true
sources = [
"browser/geolocation/geolocation_apitest.cc",
"browser/shell_browsertest.cc",
"test/shell_apitest.cc",
"test/shell_apitest.h",
"test/shell_test.cc",
"test/shell_test.h",
"test/shell_test_launcher_delegate.cc",
"test/shell_test_launcher_delegate.h",
"test/shell_tests_main.cc",
]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
deps = [
":app_shell_lib",
"//base",
"//base/test:test_support",
"//components/version_info",
"//content/shell:content_shell_lib",
"//content/test:test_support",
"//extensions:test_support",
"//extensions/browser",
"//extensions/common",
]
if (use_aura) {
deps += [ "//ui/aura" ]
}
}
source_set("unit_tests") {
testonly = true
sources = []
deps = [
":app_shell_lib",
"//base",
"//base/test:test_support",
"//extensions/browser",
]
if (is_chromeos) {
deps += [
"//chromeos:test_support",
"//components/keyed_service/content",
]
}
}