Chromium Code Reviews| Index: build/config/ios/rules.gni |
| diff --git a/build/config/ios/rules.gni b/build/config/ios/rules.gni |
| index cf2548f1bfbc2999dd45695702ee483237faf819..54dbbe42567a732118e2c25422266459fb39e9ed 100644 |
| --- a/build/config/ios/rules.gni |
| +++ b/build/config/ios/rules.gni |
| @@ -157,6 +157,15 @@ template("lipo_binary") { |
| # (optional) boolean, control whether code signing is enabled or not, |
| # default to ios_enable_code_signing if not defined. |
| # |
| +# entitlements_path: |
| +# (optional) path to the template to use to generate the application |
| +# entitlements by performing variable substitutions, defaults to |
| +# //build/config/ios/entitlements.plist. |
| +# |
| +# entitlements_target: |
| +# (optional) label of the target generating the application |
| +# entitlements; cannot be defined at the same time as entitlements_path. |
| +# |
| template("create_signed_bundle") { |
| assert(defined(invoker.product_type), |
| "product_type must be defined for $target_name") |
| @@ -180,9 +189,19 @@ template("create_signed_bundle") { |
| _bundle_extension = invoker.bundle_extension |
| _bundle_root_dir = "$root_out_dir/$_output_name$_bundle_extension" |
| - _entitlements_path = "//build/config/ios/entitlements.plist" |
| - if (defined(invoker.entitlements_path)) { |
| - _entitlements_path = invoker.entitlements_path |
| + if (!defined(invoker.entitlements_target)) { |
| + _entitlements_path = "//build/config/ios/entitlements.plist" |
| + if (defined(invoker.entitlements_path)) { |
| + _entitlements_path = invoker.entitlements_path |
| + } |
| + } else { |
| + assert(!defined(invoker.entitlements_path), |
| + "Cannot define both entitlements_path and entitlements_target " + |
| + "for $target_name") |
| + |
| + _entitlements_target_outputs = |
| + get_target_outputs(invoker.entitlements_target) |
| + _entitlements_path = _entitlements_target_outputs[0] |
|
Olivier
2016/11/04 08:49:39
Should it be documented somewhere that target that
Dirk Pranke
2016/11/04 17:12:11
Seems like a good suggestion (at least the first p
|
| } |
| _enable_code_signing = ios_enable_code_signing |
| @@ -219,6 +238,12 @@ template("create_signed_bundle") { |
| } |
| deps += invoker.bundle_deps |
| } |
| + if (defined(invoker.entitlements_target)) { |
| + if (!defined(deps)) { |
| + deps = [] |
| + } |
| + deps += [ invoker.entitlements_target ] |
| + } |
| code_signing_script = "//build/config/ios/codesign.py" |
| code_signing_sources = [ |
| @@ -369,6 +394,10 @@ template("ios_info_plist") { |
| # entitlements by performing variable substitutions, defaults to |
| # //build/config/ios/entitlements.plist. |
| # |
| +# entitlements_target: |
| +# (optional) label of the target generating the application |
| +# entitlements; cannot be defined at the same time as entitlements_path. |
| +# |
| # bundle_extension: |
| # (optional) bundle extension including the dot, default to ".app". |
| # |
| @@ -402,6 +431,7 @@ template("ios_app_bundle") { |
| "bundle_extension", |
| "enable_code_signing", |
| "entitlements_path", |
| + "entitlements_target", |
| "extra_substitutions", |
| "extra_system_frameworks", |
| "info_plist", |
| @@ -430,6 +460,7 @@ template("ios_app_bundle") { |
| "bundle_extension", |
| "enable_code_signing", |
| "entitlements_path", |
| + "entitlements_target", |
| "extra_substitutions", |
| "extra_system_frameworks", |
| "info_plist", |
| @@ -539,9 +570,19 @@ template("ios_app_bundle") { |
| } |
| if (current_toolchain == default_toolchain) { |
| - _entitlements_path = "//build/config/ios/entitlements.plist" |
| - if (defined(invoker.entitlements_path)) { |
| - _entitlements_path = invoker.entitlements_path |
| + if (!defined(invoker.entitlements_target)) { |
| + _entitlements_path = "//build/config/ios/entitlements.plist" |
| + if (defined(invoker.entitlements_path)) { |
| + _entitlements_path = invoker.entitlements_path |
| + } |
| + } else { |
| + assert(!defined(invoker.entitlements_path), |
| + "Cannot define both entitlements_path and entitlements_target" + |
| + "for $_target_name") |
| + |
| + _entitlements_target_outputs = |
| + get_target_outputs(invoker.entitlements_target) |
| + _entitlements_path = _entitlements_target_outputs[0] |
| } |
| action(_generate_entitlements_target) { |
| @@ -552,6 +593,9 @@ template("ios_app_bundle") { |
| deps = [ |
| ":$_generate_info_plist", |
| ] |
| + if (defined(invoker.entitlements_target)) { |
| + deps += [ invoker.entitlements_target ] |
| + } |
| sources = [ |
| _entitlements_path, |
| _info_plist_path, |
| @@ -598,6 +642,7 @@ template("ios_app_bundle") { |
| "deps", |
| "enable_code_signing", |
| "entitlements_path", |
| + "entitlements_target", |
| "extra_system_frameworks", |
| "product_type", |
| "public_configs", |