Commit 047490e7 authored by sdefresne's avatar sdefresne Committed by Commit bot

Add bundle_deps to ios_{app,framework}_bundle templates.

Allow to specify dependencies that are only used by the create_bundle
target when using ios_app_bundle or ios_framework_bundle templates to
increase parallelism.

BUG=629867

Review-Url: https://codereview.chromium.org/2169973002
Cr-Commit-Position: refs/heads/master@{#407102}
parent 1fb838fe
...@@ -158,6 +158,7 @@ template("ios_app_bundle") { ...@@ -158,6 +158,7 @@ template("ios_app_bundle") {
forward_variables_from(invoker, forward_variables_from(invoker,
"*", "*",
[ [
"bundle_deps",
"bundle_extension", "bundle_extension",
"entitlements_path", "entitlements_path",
"extra_substitutions", "extra_substitutions",
...@@ -236,6 +237,7 @@ template("ios_app_bundle") { ...@@ -236,6 +237,7 @@ template("ios_app_bundle") {
forward_variables_from(invoker, forward_variables_from(invoker,
"*", "*",
[ [
"bundle_deps",
"bundle_extension", "bundle_extension",
"data_deps", "data_deps",
"entitlements_path", "entitlements_path",
...@@ -379,6 +381,9 @@ template("ios_app_bundle") { ...@@ -379,6 +381,9 @@ template("ios_app_bundle") {
} else { } else {
deps += [ ":$_bundle_data_executable" ] deps += [ ":$_bundle_data_executable" ]
} }
if (defined(invoker.bundle_deps)) {
deps += invoker.bundle_deps
}
if (use_ios_simulator) { if (use_ios_simulator) {
if (!defined(data_deps)) { if (!defined(data_deps)) {
...@@ -462,6 +467,9 @@ template("ios_app_bundle") { ...@@ -462,6 +467,9 @@ template("ios_app_bundle") {
if (defined(invoker.product_type)) { if (defined(invoker.product_type)) {
assert(invoker.product_type != "", "mark product_type as used") assert(invoker.product_type != "", "mark product_type as used")
} }
if (defined(invoker.bundle_deps)) {
assert(invoker.bundle_deps != [], "mark bundle_deps as used")
}
} }
set_defaults("ios_app_bundle") { set_defaults("ios_app_bundle") {
......
...@@ -244,6 +244,7 @@ template("framework_bundle") { ...@@ -244,6 +244,7 @@ template("framework_bundle") {
"*", "*",
[ [
"assert_no_deps", "assert_no_deps",
"bundle_deps",
"data_deps", "data_deps",
"info_plist", "info_plist",
"output_name", "output_name",
...@@ -267,6 +268,10 @@ template("framework_bundle") { ...@@ -267,6 +268,10 @@ template("framework_bundle") {
":$_target_name($default_toolchain)", ":$_target_name($default_toolchain)",
] ]
} }
if (defined(invoker.bundle_deps)) {
assert(invoker.bundle_deps != [], "mark bundle_deps as used")
}
} else { } else {
# If the framework is unversioned, the final _target_name will be the # If the framework is unversioned, the final _target_name will be the
# create_bundle(_framework_target), otherwise an action with the name # create_bundle(_framework_target), otherwise an action with the name
...@@ -299,6 +304,7 @@ template("framework_bundle") { ...@@ -299,6 +304,7 @@ template("framework_bundle") {
"*", "*",
[ [
"assert_no_deps", "assert_no_deps",
"bundle_deps",
"data_deps", "data_deps",
"info_plist", "info_plist",
"output_name", "output_name",
...@@ -428,6 +434,10 @@ template("framework_bundle") { ...@@ -428,6 +434,10 @@ template("framework_bundle") {
} }
public_deps += [ ":$_shared_library_bundle_data" ] public_deps += [ ":$_shared_library_bundle_data" ]
if (defined(invoker.bundle_deps)) {
public_deps += invoker.bundle_deps
}
bundle_root_dir = _framework_root_dir bundle_root_dir = _framework_root_dir
bundle_resources_dir = "$bundle_root_dir/Resources" bundle_resources_dir = "$bundle_root_dir/Resources"
bundle_executable_dir = "$bundle_root_dir" bundle_executable_dir = "$bundle_root_dir"
......
...@@ -70,7 +70,7 @@ ios_info_plist("compile_cronet_plist") { ...@@ -70,7 +70,7 @@ ios_info_plist("compile_cronet_plist") {
# Bundle plist into Cronet.Framework. # Bundle plist into Cronet.Framework.
bundle_data("cronet_info_plist") { bundle_data("cronet_info_plist") {
deps = [ public_deps = [
":compile_cronet_plist", ":compile_cronet_plist",
] ]
...@@ -86,13 +86,13 @@ ios_framework_bundle("cronet_framework") { ...@@ -86,13 +86,13 @@ ios_framework_bundle("cronet_framework") {
output_name = "Cronet" output_name = "Cronet"
deps = [ deps = [
":compile_cronet_plist",
":cronet_info_plist",
":cronet_sources", ":cronet_sources",
"//base", "//base",
"//net:net", "//net:net",
] ]
bundle_deps = [ ":cronet_info_plist" ]
libs = [ "UIKit.Framework" ] libs = [ "UIKit.Framework" ]
public_headers = [ public_headers = [
......
...@@ -281,7 +281,7 @@ template("test") { ...@@ -281,7 +281,7 @@ template("test") {
_resources_bundle_data = target_name + "_resources_bundle_data" _resources_bundle_data = target_name + "_resources_bundle_data"
bundle_data(_resources_bundle_data) { bundle_data(_resources_bundle_data) {
visibility = [ ":*" ] visibility = [ ":$_test_target" ]
sources = [ sources = [
"//testing/gtest_ios/Default.png", "//testing/gtest_ios/Default.png",
] ]
...@@ -320,12 +320,14 @@ template("test") { ...@@ -320,12 +320,14 @@ template("test") {
deps = [] deps = []
} }
deps += [ deps += [
":$_resources_bundle_data",
# All shared libraries must have the sanitizer deps to properly link in # All shared libraries must have the sanitizer deps to properly link in
# asan mode (this target will be empty in other cases). # asan mode (this target will be empty in other cases).
"//build/config/sanitizers:deps", "//build/config/sanitizers:deps",
] ]
if (!defined(bundle_deps)) {
bundle_deps = []
}
bundle_deps += [ ":$_resources_bundle_data" ]
} }
} else { } else {
executable(target_name) { executable(target_name) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment