chromium/ios/chrome/search_widget_extension/BUILD.gn

# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/locales.gni")
import("//ios/build/chrome_build.gni")
import("//ios/chrome/tools/strings/generate_localizable_strings.gni")
import("//tools/grit/repack.gni")

assert(
    ios_enable_search_widget_extension,
    "ios_enable_search_widget_extension must be true to depend on //ios/chrome/search_widget_extension")

source_set("search_widget") {
  sources = [
    "search_widget_view_controller.h",
    "search_widget_view_controller.mm",
  ]

  deps = [
    "//base",
    "//ios/chrome/common/crash_report",
    "//ios/chrome/common/ui/elements",
    "//ios/chrome/common/ui/util",
  ]

  frameworks = [
    "Foundation.framework",
    "NotificationCenter.framework",
    "UIKit.framework",
  ]

  assert_no_deps = [ "//ios/chrome/browser/*" ]
}

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_${branding_path_product}_strings_" ]

  deps = [ "//ios/chrome/search_widget_extension/strings:ios_search_widget_extension_branded_strings" ]
}

generate_localizable_strings("system_strings") {
  visibility = [ "//ios/chrome/search_widget_extension/*" ]
  _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_branded_strings",
    _packed_resources_target,
  ]
}