blob: 32653486f3624a9b660c2b385c49778a1249d4aa [file] [log] [blame]
# Copyright 2024 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/apple/compile_entitlements.gni")
import("//build/apple/tweak_info_plist.gni")
import("//build/config/ios/rules.gni")
import("//build/ios/extension_bundle_data.gni")
import("//ios/build/chrome_build.gni")
import("//ios/build/config.gni")
template("browserkit_extension") {
_process_target = target_name
_bundle_name = "test_${_process_target}"
target_name = _bundle_name
tweak_info_plist("tweak_${target_name}_plist") {
info_plist = "//content/app/ios/appex/${_process_target}.plist"
}
extension_bundle_data("${target_name}_bundle") {
forward_variables_from(invoker, TESTONLY_AND_VISIBILITY)
extension_dir = "Extensions"
extension_name = "${_bundle_name}.appex"
extension_target = ":${_bundle_name}"
}
compile_entitlements("${target_name}_entitlements") {
substitutions = [ "IOS_BUNDLE_ID_PREFIX=$ios_app_bundle_id_prefix" ]
output_name = "$target_gen_dir/${_process_target}.appex.entitlements"
entitlements_templates =
[ "//content/app/ios/appex/${_process_target}.appex.entitlements" ]
}
# We don't use ios_appex_bundle here because we don't want to mess with multiple
# toolkits as the core framework is built with the default toolkit.
ios_app_bundle(target_name) {
forward_variables_from(invoker,
"*",
[
"defines",
"deps",
"framework_dirs",
"frameworks",
"public_deps",
"sources",
"target_name",
])
output_name = target_name
transparent = true
deps = [
"//content/app/ios/appex:${_process_target}",
"//content/public/app",
"//content/public/app",
"//content/public/common",
"//content/shell:content_shell_app",
"//content/shell:content_shell_lib",
"//content/test:browsertest_support",
"//content/test:default_content_test_launcher",
"//third_party/icu:icudata",
]
if (!defined(ldflags)) {
ldflags = []
}
ldflags += [
"-Wl,--ignore-auto-link-option=CoreAudioTypes",
"-Wl,-no_application_extension",
"-Wl,-rpath,@executable_path/../../Frameworks",
]
product_type = "com.apple.product-type.app-extension"
entitlements_target = ":${target_name}_entitlements"
info_plist_target = ":tweak_${target_name}_plist"
}
}
set_defaults("browserkit_extension") {
configs = [ "//build/config/ios:ios_extension_executable_flags" ]
}