| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import("//build/config/ios/rules.gni") |
| 6 import("//build/config/locales.gni") |
| 7 import("//build/config/mac/base_rules.gni") |
| 8 import("//build/mac/tweak_info_plist.gni") |
| 9 import("//ios/build/chrome_build.gni") |
| 10 import("//tools/grit/repack.gni") |
| 11 import("//ios/chrome/tools/strings/generate_localizable_strings.gni") |
| 12 |
| 13 tweak_info_plist("tweak_info_plist") { |
| 14 info_plist = "Info.plist" |
| 15 } |
| 16 |
| 17 compile_plist("entitlements") { |
| 18 format = "xml1" |
| 19 substitutions = [ "IOS_BUNDLE_ID_PREFIX=$ios_app_bundle_id_prefix" ] |
| 20 output_name = "$target_gen_dir/content_widget_extension.appex.entitlements" |
| 21 plist_templates = |
| 22 [ "entitlements/external/content_widget_extension.appex.entitlements" ] |
| 23 } |
| 24 |
| 25 ios_appex_bundle("content_widget_extension") { |
| 26 deps = [ |
| 27 ":content_widget", |
| 28 ":system_strings", |
| 29 ] |
| 30 |
| 31 extra_substitutions = [ |
| 32 "CHROME_CHANNEL_SCHEME=$url_channel_scheme", |
| 33 "CHROMIUM_SHORT_NAME=$chromium_short_name", |
| 34 "WIDGET_EXTENSION_BUNDLE_ID=$chromium_bundle_id.ContentTodayExtension", |
| 35 ] |
| 36 |
| 37 entitlements_target = ":entitlements" |
| 38 info_plist_target = ":tweak_info_plist" |
| 39 } |
| 40 |
| 41 source_set("content_widget") { |
| 42 sources = [ |
| 43 "content_widget_view.h", |
| 44 "content_widget_view.mm", |
| 45 "content_widget_view_controller.h", |
| 46 "content_widget_view_controller.mm", |
| 47 ] |
| 48 |
| 49 deps = [ |
| 50 "//base", |
| 51 "//ios/chrome/common/app_group", |
| 52 ] |
| 53 |
| 54 libs = [ |
| 55 "Foundation.framework", |
| 56 "NotificationCenter.framework", |
| 57 "UIKit.framework", |
| 58 ] |
| 59 |
| 60 configs += [ "//build/config/compiler:enable_arc" ] |
| 61 } |
| 62 |
| 63 source_set("unit_tests") { |
| 64 testonly = true |
| 65 sources = [ |
| 66 "content_widget_view_controller_unittest.mm", |
| 67 ] |
| 68 deps = [ |
| 69 ":content_widget", |
| 70 "//testing/gtest", |
| 71 ] |
| 72 configs += [ "//build/config/compiler:enable_arc" ] |
| 73 } |
| 74 |
| 75 repack_locales("packed_resources") { |
| 76 input_locales = ios_packed_locales |
| 77 output_locales = ios_packed_locales_as_mac_outputs |
| 78 |
| 79 source_patterns = [ "$root_gen_dir/ios/content_widget_extension/ios_content_wi
dget_extension_${branding_path_component}_strings_" ] |
| 80 |
| 81 deps = [ |
| 82 "//ios/chrome/content_widget_extension/strings:ios_content_widget_extension_
${branding_path_component}_strings", |
| 83 ] |
| 84 } |
| 85 |
| 86 generate_localizable_strings("system_strings") { |
| 87 visibility = [ ":*" ] |
| 88 _packed_resources_target = ":packed_resources" |
| 89 config_file = "content_widget_extension_localize_strings_config.plist" |
| 90 datapack_dir = get_label_info(_packed_resources_target, "target_gen_dir") |
| 91 packed_locales = ios_packed_locales_as_mac_outputs |
| 92 output_filenames = [ "InfoPlist.strings" ] |
| 93 deps = [ |
| 94 "//ios/chrome/content_widget_extension/strings:ios_content_widget_extension_
chromium_strings", |
| 95 |
| 96 # Depends on both branding strings target to ensure the proper .h exists |
| 97 # (the .plist configuration can only reference one of them, and their |
| 98 # content is identical). |
| 99 "//ios/chrome/content_widget_extension/strings:ios_content_widget_extension_
google_chrome_strings", |
| 100 _packed_resources_target, |
| 101 ] |
| 102 } |
| OLD | NEW |