blob: 6fca39827ec6e6440a95b758a334a552ca3f6f1e [file] [log] [blame]
# 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.
import("//build/buildflag_header.gni")
import("//build/config/ios/rules.gni")
import("//build/config/mac/base_rules.gni")
import("//build/mac/tweak_info_plist.gni")
import("//ios/build/chrome_build.gni")
import("//ios/build/config.gni")
import("//ios/public/provider/chrome/browser/build_config.gni")
import("//ios/third_party/firebase/firebase.gni")
import("//services/service_manager/public/service_manifest.gni")
buildflag_header("firebase_buildflags") {
header = "firebase_buildflags.h"
flags = [ "FIREBASE_ENABLED=$ios_enable_firebase_sdk" ]
}
service_manifest("chrome_browser_manifest_overlay") {
source = "//ios/chrome/browser/chrome_browser_manifest_overlay.json"
packaged_services = [ "//services/identity:manifest" ]
}
source_set("app") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"deferred_initialization_runner.h",
"deferred_initialization_runner.mm",
]
deps = [
"//base",
]
libs = [ "Foundation.framework" ]
}
source_set("unit_tests") {
configs += [ "//build/config/compiler:enable_arc" ]
testonly = true
sources = [
"chrome_overlay_window_testing.h",
"deferred_initialization_runner_unittest.mm",
"main_application_delegate_unittest.mm",
"tab_opener_unittest.mm",
]
deps = [
":app",
":app_internal",
"//base",
"//base/test:test_support",
"//ios/chrome/app/application_delegate:application_delegate_internal",
"//ios/chrome/browser",
"//ios/chrome/browser/tabs",
"//ios/chrome/common/app_group",
"//ios/chrome/test/base",
"//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser/distribution",
"//testing/gtest",
"//third_party/ocmock",
"//url",
]
}
source_set("tests_hook") {
# This target is intentionally not test-only, as the main app depends on it.
sources = [
"tests_hook.h",
]
}
source_set("tests_fake_hook") {
configs += [ "//build/config/compiler:enable_arc" ]
# This target is intentionally not test-only, as the main app depends on it.
sources = [
"tests_fake_hook.mm",
]
deps = [
":tests_hook",
]
}
tweak_info_plist("info_plist") {
info_plists = [
"resources/Info.plist",
"resources/ChromeAddition+Info.plist",
]
if (ios_chrome_info_plist_additions != []) {
info_plists += ios_chrome_info_plist_additions
}
if (ios_encryption_export_compliance_code != "") {
info_plists += [ "resources/EncryptionExportCompliance+Info.plist" ]
}
args = [
"--breakpad=$breakpad_enabled_as_int",
"--branding=$chromium_short_name",
]
}
compile_entitlements("entitlements") {
entitlements_templates = [ "resources/Chrome.entitlements" ]
if (ios_chrome_entitlements_additions != []) {
entitlements_templates += ios_chrome_entitlements_additions
}
substitutions = [ "IOS_BUNDLE_ID_PREFIX=$ios_app_bundle_id_prefix" ]
output_name = "$target_gen_dir/$chromium_short_name.entitlements"
}
source_set("app_internal") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"application_mode.h",
"chrome_overlay_window.h",
"chrome_overlay_window.mm",
"main_application_delegate.h",
"main_application_delegate.mm",
"main_application_delegate_testing.h",
"main_controller.h",
"main_controller.mm",
"main_controller_private.h",
"memory_monitor.h",
"memory_monitor.mm",
"startup_tasks.h",
"startup_tasks.mm",
]
deps = [
":app",
":firebase_buildflags",
":tests_hook",
"//base",
"//components/bookmarks/browser",
"//components/browser_sync",
"//components/browsing_data/core",
"//components/component_updater",
"//components/component_updater:crl_set_remover",
"//components/content_settings/core/browser",
"//components/crash/core/common",
"//components/favicon/core",
"//components/favicon_base",
"//components/feature_engagement",
"//components/handoff",
"//components/history/core/browser",
"//components/infobars/core",
"//components/keyed_service/core",
"//components/keyed_service/ios",
"//components/metrics",
"//components/ntp_snippets",
"//components/password_manager/core/common",
"//components/payments/core",
"//components/prefs",
"//components/prefs/ios",
"//components/proxy_config",
"//components/signin/core/browser",
"//components/suggestions",
"//components/sync",
"//components/url_formatter",
"//components/web_resource",
"//ios/chrome/app/application_delegate",
"//ios/chrome/app/application_delegate:application_delegate_internal",
"//ios/chrome/app/spotlight",
"//ios/chrome/app/startup",
"//ios/chrome/app/startup:startup_basic",
"//ios/chrome/app/strings",
"//ios/chrome/browser",
"//ios/chrome/browser/bookmarks",
"//ios/chrome/browser/browser_state",
"//ios/chrome/browser/browser_state:browser_state_impl",
"//ios/chrome/browser/browsing_data",
"//ios/chrome/browser/content_settings",
"//ios/chrome/browser/crash_report",
"//ios/chrome/browser/crash_report:crash_report_internal",
"//ios/chrome/browser/download",
"//ios/chrome/browser/favicon",
"//ios/chrome/browser/feature_engagement",
"//ios/chrome/browser/first_run",
"//ios/chrome/browser/geolocation",
"//ios/chrome/browser/geolocation:geolocation_internal",
"//ios/chrome/browser/history",
"//ios/chrome/browser/mailto:feature_flags",
"//ios/chrome/browser/memory",
"//ios/chrome/browser/metrics",
"//ios/chrome/browser/metrics:metrics_internal",
"//ios/chrome/browser/net",
"//ios/chrome/browser/ntp_snippets",
"//ios/chrome/browser/omaha",
"//ios/chrome/browser/passwords",
"//ios/chrome/browser/payments",
"//ios/chrome/browser/payments:constants",
"//ios/chrome/browser/reading_list",
"//ios/chrome/browser/search_engines",
"//ios/chrome/browser/share_extension",
"//ios/chrome/browser/signin",
"//ios/chrome/browser/snapshots",
"//ios/chrome/browser/suggestions",
"//ios/chrome/browser/sync",
"//ios/chrome/browser/tabs",
"//ios/chrome/browser/ui",
"//ios/chrome/browser/ui:ui_internal",
"//ios/chrome/browser/ui/authentication",
"//ios/chrome/browser/ui/commands",
"//ios/chrome/browser/ui/download",
"//ios/chrome/browser/ui/first_run",
"//ios/chrome/browser/ui/history",
"//ios/chrome/browser/ui/main",
"//ios/chrome/browser/ui/main:feature_flags",
"//ios/chrome/browser/ui/promos",
"//ios/chrome/browser/ui/settings",
"//ios/chrome/browser/ui/signin_interaction",
"//ios/chrome/browser/ui/stack_view",
"//ios/chrome/browser/ui/tab_grid",
"//ios/chrome/browser/ui/tab_grid:tab_grid_ui",
"//ios/chrome/browser/ui/tab_switcher",
"//ios/chrome/browser/ui/tab_switcher:modes",
"//ios/chrome/browser/ui/tabs",
"//ios/chrome/browser/ui/toolbar/clean:toolbar_ui",
"//ios/chrome/browser/ui/toolbar/public",
"//ios/chrome/browser/ui/util",
"//ios/chrome/browser/ui/webui:webui_internal",
"//ios/chrome/browser/upgrade",
"//ios/chrome/browser/variations:ios_chrome_ui_string_overrider_factory",
"//ios/chrome/browser/voice",
"//ios/chrome/browser/web:tab_id_tab_helper",
"//ios/chrome/browser/web:web_internal",
"//ios/chrome/browser/web_state_list",
"//ios/chrome/common",
"//ios/chrome/common/app_group",
"//ios/chrome/common/app_group:main_app",
"//ios/net",
"//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser/distribution",
"//ios/public/provider/chrome/browser/mailto",
"//ios/public/provider/chrome/browser/signin",
"//ios/public/provider/chrome/browser/user_feedback",
"//ios/testing/perf:startup",
"//ios/third_party/material_roboto_font_loader_ios",
"//ios/web",
"//ios/web/public/app",
"//mojo/core/embedder",
"//net",
"//skia",
"//ui/base",
"//ui/gfx",
"//ui/resources",
"//ui/strings:ui_strings",
]
libs = [
"CoreSpotlight.framework",
"MediaPlayer.framework",
]
allow_circular_includes_from =
[ "//ios/chrome/app/application_delegate:application_delegate_internal" ]
}
source_set("main") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"chrome_exe_main.mm",
]
deps = [
":app_internal",
"//base",
"//components/crash/core/common",
"//ios/chrome/app/startup:startup_basic",
"//ios/chrome/browser/crash_report",
"//ios/chrome/common",
"//ios/testing/perf:startup",
"//third_party/google_toolbox_for_mac",
]
}
ios_app_bundle("chrome") {
output_name = chromium_short_name
entitlements_target = ":entitlements"
info_plist_target = ":info_plist"
bundle_deps = [ "//ios/chrome/app/resources" ]
if (!is_chrome_branded || ios_chrome_app_variants == []) {
bundle_deps += [ ios_application_icons_target ]
} else {
variants = ios_chrome_app_variants
}
deps = [
":main",
":tests_fake_hook",
]
if (ios_enable_firebase_sdk) {
deps += [ "//ios/third_party/firebase" ]
}
if (current_toolchain == default_toolchain) {
if (ios_enable_search_widget_extension) {
deps += [ ":search_widget_extension_bundle" ]
}
if (ios_enable_content_widget_extension) {
deps += [ ":content_widget_extension_bundle" ]
}
if (ios_enable_share_extension) {
deps += [ ":share_extension_bundle" ]
}
}
extra_substitutions = [
"CONTENT_WIDGET_EXTENSION_BUNDLE_ID=$chromium_bundle_id.ContentTodayExtension",
"CHROMIUM_BUNDLE_ID=$chromium_bundle_id",
"CHROMIUM_HANDOFF_ID=$chromium_handoff_id",
"CHROMIUM_SHORT_NAME=$chromium_short_name",
"CHROMIUM_URL_SCHEME_1=$url_unsecure_scheme",
"CHROMIUM_URL_SCHEME_2=$url_secure_scheme",
"CHROMIUM_URL_SCHEME_3=$url_x_callback_scheme",
"CHROMIUM_URL_CHANNEL_SCHEME=$url_channel_scheme",
"SSOAUTH_URL_SCHEME=$url_ssoauth_scheme",
]
if (ios_encryption_export_compliance_code != "") {
extra_substitutions += [ "ENCRYPTION_EXPORT_COMPLIANCE_CODE=" +
ios_encryption_export_compliance_code ]
}
assert_no_deps = ios_assert_no_deps + ios_chrome_extra_assert_no_deps
}
if (current_toolchain == default_toolchain) {
if (ios_enable_content_widget_extension) {
bundle_data("content_widget_extension_bundle") {
public_deps = [
"//ios/chrome/content_widget_extension",
]
sources = [
"$root_out_dir/content_widget_extension.appex",
]
outputs = [
"{{bundle_plugins_dir}}/{{source_file_part}}",
]
}
}
if (ios_enable_search_widget_extension) {
bundle_data("search_widget_extension_bundle") {
public_deps = [
"//ios/chrome/search_widget_extension",
]
sources = [
"$root_out_dir/search_widget_extension.appex",
]
outputs = [
"{{bundle_plugins_dir}}/{{source_file_part}}",
]
}
}
if (ios_enable_share_extension) {
bundle_data("share_extension_bundle") {
public_deps = [
"//ios/chrome/share_extension",
]
sources = [
"$root_out_dir/share_extension.appex",
]
outputs = [
"{{bundle_plugins_dir}}/{{source_file_part}}",
]
}
}
}