Skip to content

Commit

Permalink
Set TEST_TARGET_NAME only when a project has UITest bundle (#792)
Browse files Browse the repository at this point in the history
* Set `TEST_TARGET_NAME` only for UITest

* Update CHANGELOG.md
  • Loading branch information
ken0nek authored Feb 26, 2020
1 parent 94498fa commit f510b44
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#### Fixed
- Set `defaultConfigurationName` for every target which is defined in a project. [#787](https://github.com/yonaskolb/XcodeGen/pull/787)
- Set `TEST_TARGET_NAME` only when a project has UITest bundle. [#792](https://github.com/yonaskolb/XcodeGen/pull/792) @ken0nek

## 2.13.1

Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGenKit/PBXProjGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ public class PBXProjGenerator {
}

// automatically set test target name
if target.type == .uiTestBundle || target.type == .unitTestBundle,
if target.type == .uiTestBundle,
!project.targetHasBuildSetting("TEST_TARGET_NAME", target: target, config: config) {
for dependency in target.dependencies {
if dependency.type == .target,
Expand Down
18 changes: 0 additions & 18 deletions Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1618,15 +1618,9 @@
0867B0DACEF28C11442DE8F7 = {
ProvisioningStyle = Automatic;
};
71E2BDAC4B8E8FC2BBF75C55 = {
TestTargetID = 020A320BB3736FCDE6CC4E70;
};
BF3693DCA6182D7AEC410AFC = {
CUSTOM = value;
};
DC2F16BAA6E13B44AB62F888 = {
TestTargetID = 0867B0DACEF28C11442DE8F7;
};
F674B2CFC4738EEC49BAD0DA = {
TestTargetID = 0867B0DACEF28C11442DE8F7;
};
Expand Down Expand Up @@ -2619,7 +2613,6 @@
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_iOS.app/App_iOS";
TEST_TARGET_NAME = App_iOS;
};
name = "Staging Release";
};
Expand Down Expand Up @@ -2665,7 +2658,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS-Tests";
SDKROOT = macosx;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_macOS.app/Contents/MacOS/App_macOS";
TEST_TARGET_NAME = App_macOS;
};
name = "Test Release";
};
Expand Down Expand Up @@ -2993,7 +2985,6 @@
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_iOS.app/App_iOS";
TEST_TARGET_NAME = App_iOS;
};
name = "Staging Debug";
};
Expand All @@ -3015,7 +3006,6 @@
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_iOS.app/App_iOS";
TEST_TARGET_NAME = App_iOS;
};
name = "Test Debug";
};
Expand Down Expand Up @@ -3213,7 +3203,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS-Tests";
SDKROOT = macosx;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_macOS.app/Contents/MacOS/App_macOS";
TEST_TARGET_NAME = App_macOS;
};
name = "Test Debug";
};
Expand Down Expand Up @@ -3389,7 +3378,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS-Tests";
SDKROOT = macosx;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_macOS.app/Contents/MacOS/App_macOS";
TEST_TARGET_NAME = App_macOS;
};
name = "Production Debug";
};
Expand All @@ -3411,7 +3399,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS-Tests";
SDKROOT = macosx;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_macOS.app/Contents/MacOS/App_macOS";
TEST_TARGET_NAME = App_macOS;
};
name = "Production Release";
};
Expand Down Expand Up @@ -4011,7 +3998,6 @@
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_iOS.app/App_iOS";
TEST_TARGET_NAME = App_iOS;
};
name = "Test Release";
};
Expand Down Expand Up @@ -4888,7 +4874,6 @@
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_iOS.app/App_iOS";
TEST_TARGET_NAME = App_iOS;
};
name = "Production Release";
};
Expand Down Expand Up @@ -5116,7 +5101,6 @@
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_iOS.app/App_iOS";
TEST_TARGET_NAME = App_iOS;
};
name = "Production Debug";
};
Expand Down Expand Up @@ -5692,7 +5676,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS-Tests";
SDKROOT = macosx;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_macOS.app/Contents/MacOS/App_macOS";
TEST_TARGET_NAME = App_macOS;
};
name = "Staging Release";
};
Expand Down Expand Up @@ -5874,7 +5857,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS-Tests";
SDKROOT = macosx;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/App_macOS.app/Contents/MacOS/App_macOS";
TEST_TARGET_NAME = App_macOS;
};
name = "Staging Debug";
};
Expand Down

0 comments on commit f510b44

Please sign in to comment.