1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
# 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/config/features.gni") # For `use_blink`
declare_args() {
# Configure the environment for which to build. Could be either "device",
# "simulator" or "catalyst". Must be specified.
target_environment = ""
# Valid values: "iphoneos" (default), "tvos", "watchos".
# Indicates the kind of iOS or iOS-based platform that is being targeted.
# Note that this value is available only when is_ios is also true (i.e. it
# cannot be used with the host toolchain).
target_platform = "iphoneos"
# Control whether codesiging is enabled (ignored for simulator builds).
# TODO(crbug.com/378918882): Prefix with apple_mobile_ instead of ios_.
ios_enable_code_signing = true
# Explicitly select the identity to use for codesigning. If defined, must
# be set to a non-empty string that will be passed to codesigning. Can be
# left unspecified if ios_code_signing_identity_description is used instead.
# TODO(crbug.com/378918882): Prefix with apple_mobile_ instead of ios_.
ios_code_signing_identity = ""
# Pattern used to select the identity to use for codesigning. If defined,
# must be a substring of the description of exactly one of the identities by
# `security find-identity -v -p codesigning`.
# TODO(crbug.com/378918882): Prefix with apple_mobile_ instead of ios_.
ios_code_signing_identity_description = "Apple Development"
# Prefix for CFBundleIdentifier property of iOS bundles (correspond to the
# "Organization Identifier" in Xcode). Code signing will fail if no mobile
# provisioning for the selected code signing identify support that prefix.
# TODO(crbug.com/378918882): Prefix with apple_mobile_ instead of ios_.
ios_app_bundle_id_prefix = "org.chromium.ost"
# Suffix for CFBundleIdentifier property of iOS Chrome signed bundles
# (main bundle and extensions). Code signing will fail if no mobile
# provisioning for the selected code signing identify support that suffix.
# For extension, the suffix will be added before the extension identifier.
# The suffix is not added to test applications.
# No dot is added before the suffix, so add one if needed.
apple_mobile_app_bundle_id_suffix = ".dev"
# Paths to the mobileprovision files for the chosen code signing
# identity description and app bundle id prefix.
# TODO(crbug.com/378918882): Prefix with apple_mobile_ instead of ios_.
ios_mobileprovision_files = []
}
# As entitlements are tied to a specific bundle identifier, all the
# test applications share the same identifier. This simplifies adding
# new test application (since there is no need to investigate which
# entitlements they need, nor to wait for the mobile provision with
# those entitlements to be generated by Apple and then deployed to the
# infrastructure, ...). The drawback is that only one test application
# can be installed at a time on a device/simulator (as the bundle
# identifier uniquely identify an application).
#
# This variable corresponds to the test bundle identifier.
shared_bundle_id_for_test_apps =
"$ios_app_bundle_id_prefix.chrome.unittests.dev"
# This file is included on all platforms, but the automatic configuration of
# the variables can only be executed if building for ios or watchos (as they
# either have no meaning or depend on tools that are only available on macOS).
if (is_ios || is_watchos) {
# Check that target_platform and target_environment are set to supported
# values.
_target_platforms = []
if (is_ios) {
_target_platforms += [
"iphoneos",
"tvos",
]
} else if (is_watchos) {
_target_platforms += [
"iphoneos",
"watchos",
]
}
assert(filter_include([ target_platform ], _target_platforms) != [],
"target_platform '$target_platform' does not match a target value: " +
"$_target_platforms")
_target_environments = [
"simulator",
"device",
]
if (is_ios && target_platform == "iphoneos") {
_target_environments += [ "catalyst" ]
}
assert(filter_include([ target_environment ], _target_environments) != [],
"target_environment must be in $_target_environments: " +
"$target_environment")
if (target_environment == "device" && ios_enable_code_signing) {
# If codesigning is enabled, user must configure either a codesigning
# identity or a filter to automatically select the codesigning identity.
assert(ios_code_signing_identity == "" ||
ios_code_signing_identity_description == "",
"You should either specify the precise identity to use with " +
"ios_code_signing_identity or let the code select an identity " +
"automatically (via find_signing_identity.py which use the " +
"variable ios_code_signing_identity_description to set the " +
"pattern to match the identity to use).")
# Automatically select a codesigning identity if no identity is configured.
# This only applies to device build as simulator builds are not signed.
if (ios_code_signing_identity == "") {
find_signing_identity_args = []
if (ios_code_signing_identity_description != "") {
find_signing_identity_args = [
"--matching-pattern",
ios_code_signing_identity_description,
]
}
ios_code_signing_identity =
exec_script("//build/config/apple/find_signing_identity.py",
find_signing_identity_args,
"trim string")
}
}
# Sanity check: tvOS builds require `use_blink`.
if (target_platform == "tvos") {
assert(use_blink, "tvOS builds require use_blink=true")
}
}
|