| # Copyright 2017 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/apple/compile_entitlements.gni") |
| import("//build/apple/tweak_info_plist.gni") |
| import("//build/config/ios/rules.gni") |
| import("//build/config/locales.gni") |
| import("//ios/build/chrome_build.gni") |
| import("//ios/build/config.gni") |
| import("//ios/chrome/tools/strings/generate_localizable_strings.gni") |
| import("//tools/grit/repack.gni") |
| |
| assert(ios_deployment_target == "13.0", |
| "search_widget_extension must target iOS 13.0") |
| |
| assert( |
| ios_enable_search_widget_extension, |
| "ios_enable_search_widget_extension must be true to depend on //ios/chrome/search_widget_extension") |
| |
| tweak_info_plist("tweak_info_plist") { |
| info_plist = "Info.plist" |
| } |
| |
| compile_entitlements("entitlements") { |
| substitutions = [ "IOS_BUNDLE_ID_PREFIX=$ios_app_bundle_id_prefix" ] |
| output_name = "$target_gen_dir/search_widget_extension.appex.entitlements" |
| entitlements_templates = |
| [ "entitlements/external/search_widget_extension.appex.entitlements" ] |
| } |
| |
| ios_appex_bundle("search_widget_extension") { |
| deps = [ |
| ":search_widget", |
| ":system_strings", |
| "resources:quick_action_incognito_search", |
| "resources:quick_action_scan_qr_code", |
| "resources:quick_action_search", |
| "resources:quick_action_voice_search", |
| ] |
| |
| assert_no_deps = ios_extension_assert_no_deps |
| |
| extra_substitutions = [ |
| "CHROME_CHANNEL_SCHEME=$url_channel_scheme", |
| "CHROMIUM_SHORT_NAME=$chromium_short_name", |
| ] |
| |
| entitlements_target = ":entitlements" |
| info_plist_target = ":tweak_info_plist" |
| bundle_identifier = "$chromium_bundle_id.TodayExtension" |
| } |
| |
| source_set("search_widget") { |
| sources = [ |
| "copied_content_view.h", |
| "copied_content_view.mm", |
| "search_action_view.h", |
| "search_action_view.mm", |
| "search_widget_constants.h", |
| "search_widget_constants.mm", |
| "search_widget_view.h", |
| "search_widget_view.mm", |
| "search_widget_view_controller.h", |
| "search_widget_view_controller.mm", |
| ] |
| |
| deps = [ |
| "//base", |
| "//components/open_from_clipboard:open_from_clipboard_impl", |
| "//ios/chrome/common/app_group", |
| "//ios/chrome/common/app_group:command", |
| "//ios/chrome/common/crash_report", |
| "//ios/chrome/common/ui/elements", |
| "//ios/chrome/common/ui/util", |
| "//ios/chrome/common/ui/util:image_util", |
| ] |
| |
| frameworks = [ |
| "Foundation.framework", |
| "NotificationCenter.framework", |
| "UIKit.framework", |
| ] |
| |
| assert_no_deps = [ "//ios/chrome/browser" ] |
| |
| configs += [ "//build/config/compiler:enable_arc" ] |
| } |
| |
| repack_locales("packed_resources") { |
| input_locales = platform_pak_locales |
| output_locales = locales_as_apple_outputs |
| |
| source_patterns = [ |
| "$root_gen_dir/ios/search_widget_extension/ios_search_widget_extension_strings_", |
| "$root_gen_dir/ios/search_widget_extension/ios_search_widget_extension_${branding_path_component}_strings_", |
| ] |
| |
| deps = [ |
| "//ios/chrome/search_widget_extension/strings:ios_search_widget_extension_${branding_path_component}_strings", |
| "//ios/chrome/search_widget_extension/strings:ios_search_widget_extension_strings", |
| ] |
| } |
| |
| generate_localizable_strings("system_strings") { |
| visibility = [ ":*" ] |
| _packed_resources_target = ":packed_resources" |
| config_file = "search_widget_extension_localize_strings_config.plist" |
| datapack_dir = get_label_info(_packed_resources_target, "target_gen_dir") |
| packed_locales = locales_as_apple_outputs |
| output_filenames = [ |
| "InfoPlist.strings", |
| "Localizable.strings", |
| ] |
| deps = [ |
| "//ios/chrome/search_widget_extension/strings:ios_search_widget_extension_chromium_strings", |
| |
| # Depends on both branding strings target to ensure the proper .h exists |
| # (the .plist configuration can only reference one of them, and their |
| # content is identical). |
| "//ios/chrome/search_widget_extension/strings:ios_search_widget_extension_google_chrome_strings", |
| _packed_resources_target, |
| ] |
| } |