| # Copyright 2020 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/tweak_info_plist.gni") |
| import("//build/config/ios/rules.gni") |
| import("//build/config/locales.gni") |
| import("//build/config/mac/base_rules.gni") |
| import("//ios/build/chrome_build.gni") |
| import("//ios/build/config.gni") |
| import("//ios/chrome/extension_repack.gni") |
| import("//ios/chrome/tools/strings/generate_localizable_strings.gni") |
| import("//ios/public/provider/chrome/browser/build_config.gni") |
| |
| assert( |
| ios_enable_credential_provider_extension, |
| "ios_enable_credential_provider_extension must be true to depend on //ios/chrome/credential_provider_extension") |
| |
| group("resources") { |
| deps = [ "//ios/chrome/credential_provider_extension/strings" ] |
| } |
| |
| extension_repack_all_locales("packed_resources") { |
| extension = "credential_provider_extension" |
| input_locales = ios_packed_locales |
| output_locales = ios_packed_locales_as_mac_outputs |
| } |
| |
| tweak_info_plist("tweak_info_plist") { |
| info_plist = "Info.plist" |
| |
| # TODO(crbug.com/1140474): Remove once iOS 14.2 reaches mass adoption. |
| if (ios_lock_to_version != "") { |
| args = [ "--lock-to-version=$ios_lock_to_version" ] |
| } |
| } |
| |
| compile_entitlements("entitlements") { |
| substitutions = [ |
| "IOS_BUNDLE_ID_PREFIX=$ios_app_bundle_id_prefix", |
| "CHROMIUM_BUNDLE_ID=$chromium_bundle_id", |
| ] |
| output_name = |
| "$target_gen_dir/credential_provider_extension.appex.entitlements" |
| entitlements_templates = [ |
| "entitlements/external/credential_provider_extension.appex.entitlements", |
| ] |
| if (ios_chrome_cpe_entitlements_additions != []) { |
| entitlements_templates += ios_chrome_cpe_entitlements_additions |
| } |
| } |
| |
| ios_appex_bundle("credential_provider_extension") { |
| sources = [ |
| "credential_provider_view_controller.h", |
| "credential_provider_view_controller.mm", |
| ] |
| |
| configs += [ "//build/config/compiler:enable_arc" ] |
| |
| deps = [ |
| ":account_verification_provider", |
| ":metrics_util", |
| ":password_util", |
| ":reauthentication_handler", |
| ":system_strings", |
| "//ios/chrome/common/app_group", |
| "//ios/chrome/common/app_group:client", |
| "//ios/chrome/common/credential_provider", |
| "//ios/chrome/common/credential_provider:ui", |
| "//ios/chrome/common/ui/colors", |
| "//ios/chrome/common/ui/confirmation_alert", |
| "//ios/chrome/common/ui/reauthentication", |
| "//ios/chrome/credential_provider_extension/resources", |
| "//ios/chrome/credential_provider_extension/ui", |
| ] |
| bundle_deps_filter = [ "//third_party/icu:icudata" ] |
| |
| assert_no_deps = ios_extension_assert_no_deps |
| |
| frameworks = [ |
| "AuthenticationServices.framework", |
| "Foundation.framework", |
| "UIKit.framework", |
| ] |
| |
| extra_substitutions = [ |
| "CHROME_CHANNEL_SCHEME=$url_channel_scheme", |
| "CHROMIUM_SHORT_NAME=$chromium_short_name", |
| "CREDENTIAL_PROVIDER_EXTENSION_BUNDLE_ID=$chromium_bundle_id.CredentialProviderExtension", |
| "CHROMIUM_BUNDLE_ID=$chromium_bundle_id", |
| ] |
| |
| entitlements_target = ":entitlements" |
| info_plist_target = ":tweak_info_plist" |
| xcode_product_bundle_id = "$chromium_bundle_id.CredentialProviderExtension" |
| } |
| |
| generate_localizable_strings("system_strings") { |
| visibility = [ |
| ":*", |
| "//ios/showcase:*", |
| ] |
| _packed_resources_target = ":packed_resources" |
| config_file = "credential_provider_extension_localize_strings_config.plist" |
| datapack_dir = get_label_info(_packed_resources_target, "target_gen_dir") |
| packed_locales = ios_packed_locales_as_mac_outputs |
| output_filenames = [ "Localizable.strings" ] |
| deps = [ _packed_resources_target ] |
| } |
| |
| source_set("unit_tests") { |
| testonly = true |
| sources = [ |
| "metrics_util_unittest.mm", |
| "password_util_unittest.mm", |
| ] |
| deps = [ |
| ":metrics_util", |
| ":password_util", |
| "//base", |
| "//ios/chrome/common/app_group", |
| "//testing/gtest", |
| ] |
| configs += [ "//build/config/compiler:enable_arc" ] |
| } |
| |
| source_set("reauthentication_handler") { |
| sources = [ |
| "reauthentication_handler.h", |
| "reauthentication_handler.mm", |
| ] |
| configs += [ "//build/config/compiler:enable_arc" ] |
| deps = [ |
| "//base", |
| "//ios/chrome/common/app_group", |
| "//ios/chrome/common/app_group:command", |
| "//ios/chrome/common/ui/reauthentication", |
| ] |
| } |
| |
| source_set("password_util") { |
| sources = [ |
| "password_util.h", |
| "password_util.mm", |
| ] |
| configs += [ "//build/config/compiler:enable_arc" ] |
| deps = [ |
| "//base", |
| "//ios/chrome/common/app_group", |
| "//ios/chrome/credential_provider_extension:metrics_util", |
| ] |
| frameworks = [ |
| "Security.framework", |
| "Foundation.framework", |
| ] |
| } |
| |
| source_set("metrics_util") { |
| sources = [ |
| "metrics_util.h", |
| "metrics_util.mm", |
| ] |
| configs += [ "//build/config/compiler:enable_arc" ] |
| deps = [ |
| "//base", |
| "//ios/chrome/common/app_group", |
| ] |
| frameworks = [ "Foundation.framework" ] |
| } |
| |
| source_set("account_verification_provider") { |
| public_deps = [ ":account_verification_provider_header" ] |
| deps = [ ios_account_verification_provider_target ] |
| assert_no_deps = [ "//ios/chrome/browser/*" ] |
| configs += [ "//build/config/compiler:enable_arc" ] |
| frameworks = [ "Foundation.framework" ] |
| } |
| |
| source_set("account_verification_provider_header") { |
| sources = [ "account_verification_provider.h" ] |
| assert_no_deps = [ "//ios/chrome/browser/*" ] |
| configs += [ "//build/config/compiler:enable_arc" ] |
| frameworks = [ "Foundation.framework" ] |
| } |
| |
| source_set("account_verification_provider_implementation") { |
| sources = [ "account_verification_provider.mm" ] |
| deps = [ ":account_verification_provider_header" ] |
| assert_no_deps = [ "//ios/chrome/browser/*" ] |
| configs += [ "//build/config/compiler:enable_arc" ] |
| frameworks = [ "Foundation.framework" ] |
| } |