Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: build/config/ios/rules.gni

Issue 2473103006: Rename XCTests test main target and output. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/ios/Module-Info.plist ('k') | ios/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/ios/rules.gni
diff --git a/build/config/ios/rules.gni b/build/config/ios/rules.gni
index 54dbbe42567a732118e2c25422266459fb39e9ed..b057010248683274b2e88b22822565a26816a0b3 100644
--- a/build/config/ios/rules.gni
+++ b/build/config/ios/rules.gni
@@ -1268,11 +1268,11 @@ template("ios_xctest_test") {
_output_name = invoker.output_name
}
- _xctest_target = _target_name
- _xctest_output = _output_name
+ _xctest_target = _target_name + "_module"
+ _xctest_output = _output_name + "_module"
- _host_target = _target_name + "_host"
- _host_output = _output_name + "_host"
+ _host_target = _target_name
+ _host_output = _output_name
_xctest_arch_loadable_module_target = _xctest_target + "_arch_loadable_module"
_xctest_lipo_loadable_module_target = _xctest_target + "_loadable_module"
@@ -1280,7 +1280,7 @@ template("ios_xctest_test") {
loadable_module(_xctest_arch_loadable_module_target) {
visibility = [ ":$_xctest_lipo_loadable_module_target($default_toolchain)" ]
if (current_toolchain != default_toolchain) {
- visibility += [ ":$_target_name" ]
+ visibility += [ ":$_xctest_target" ]
}
sources = [
@@ -1298,7 +1298,7 @@ template("ios_xctest_test") {
# For fat builds, only the default toolchain will generate a test bundle.
# For the other toolchains, the template is only used for building the
# arch-specific binary, thus the default target is just a group().
- group(_target_name) {
+ group(_xctest_target) {
forward_variables_from(invoker,
[
"visibility",
@@ -1314,7 +1314,8 @@ template("ios_xctest_test") {
ios_info_plist(_xctest_info_plist_target) {
visibility = [ ":$_xctest_info_plist_bundle" ]
info_plist = "//build/config/ios/Module-Info.plist"
- executable_name = _output_name
+ extra_substitutions = [ "MODULE_NAME=$_xctest_output" ]
+ executable_name = _host_output
}
bundle_data(_xctest_info_plist_bundle) {
@@ -1359,7 +1360,10 @@ template("ios_xctest_test") {
}
bundle_data(_xctest_bundle) {
- visibility = [ ":$_host_target" ]
+ visibility = [
+ ":${_host_target}",
+ ":${_host_target}_host",
baxley 2016/11/04 15:26:20 this will also go away as part of crbug.com/662404
sdefresne 2016/11/04 15:57:26 The answer would have been yes, but I tweaked the
+ ]
public_deps = [
":$_xctest_target",
]
@@ -1412,6 +1416,49 @@ template("ios_xctest_test") {
"@loader_path/Frameworks",
]
}
+
+ # TODO(crbug.com/662404): Remove when downstream have been changed to use
+ # the new name for the xctest app bundles.
+ ios_app_bundle(_host_target + "_host") {
+ forward_variables_from(invoker, "*", [ "testonly" ])
+
+ testonly = true
+ output_name = _host_output + "_host"
+ configs += [ "//build/config/ios:xctest_config" ]
+
+ if (!defined(invoker.info_plist) && !defined(invoker.info_plist_target)) {
+ info_plist = "//build/config/ios/Host-Info.plist"
+ }
+
+ # Xcode needs those two framework installed in the application (and signed)
+ # for the XCTest to run, so install them using extra_system_frameworks.
+ _ios_platform_library = "$ios_sdk_platform_path/Developer/Library"
+ extra_system_frameworks = [
+ "$_ios_platform_library/Frameworks/XCTest.framework",
+ "$_ios_platform_library/PrivateFrameworks/IDEBundleInjection.framework",
+ ]
+
+ if (current_toolchain == default_toolchain) {
+ if (!defined(bundle_deps)) {
+ bundle_deps = []
+ }
+ bundle_deps += [ ":$_xctest_bundle" ]
+ }
+
+ if (!defined(ldflags)) {
+ ldflags = []
+ }
+ ldflags += [
+ "-Xlinker",
+ "-rpath",
+ "-Xlinker",
+ "@executable_path/Frameworks",
+ "-Xlinker",
+ "-rpath",
+ "-Xlinker",
+ "@loader_path/Frameworks",
+ ]
+ }
}
set_defaults("ios_xctest_test") {
« no previous file with comments | « build/config/ios/Module-Info.plist ('k') | ios/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698