Move build settings from pbxproj to xcconfig files#780
Conversation
Use OPENSWIFTUI_TARGET_BUNDLE_ID variable defined in shared basic configs to differentiate OpenSwiftUI vs SwiftUI bundle identifiers.
Move PRODUCT_NAME to common.xcconfig using OPENSWIFTUI_TARGET_BUNDLE_ID to differentiate product names between OpenSwiftUI and SwiftUI configs. Add INFOPLIST_KEY_CFBundleDisplayName for a human-readable display name.
🤖 Augment PR SummarySummary: Centralizes Xcode build naming settings by moving bundle/product identifiers out of the 🤖 Was this summary useful? React with 👍 or 👎 |
| @@ -1,3 +1,6 @@ | |||
| PRODUCT_NAME = $(TARGET_NAME)_$(OPENSWIFTUI_TARGET_BUNDLE_ID) | |||
There was a problem hiding this comment.
PRODUCT_NAME = $(TARGET_NAME)_$(OPENSWIFTUI_TARGET_BUNDLE_ID) makes the built product name vary between SwiftUI vs OpenSwiftUI configurations, but the Example project product references are hardcoded to *_SwiftUI in project.pbxproj. If you build an OpenSwiftUI* configuration, Xcode may end up pointing at non-existent products (e.g. expecting Example_SwiftUI.app while producing Example_OpenSwiftUI.app).
Severity: medium
Other Locations
Example/Example.xcodeproj/project.pbxproj:53Example/Example.xcodeproj/project.pbxproj:55Example/Example.xcodeproj/project.pbxproj:58Example/Example.xcodeproj/project.pbxproj:60
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| /* Begin PBXFileReference section */ | ||
| 271D81642BB1E8E300A6D543 /* OpenAttributeGraph */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = OpenAttributeGraph; path = ../../OpenAttributeGraph; sourceTree = "<group>"; }; | ||
| 275751E32DEE1441003E467C /* TestingHost.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestingHost.app; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| 275751E32DEE1441003E467C /* TestingHost_SwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestingHost_SwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; }; |
There was a problem hiding this comment.
The UI test TEST_HOST build setting in this .pbxproj is still hardcoded to $(BUILT_PRODUCTS_DIR)/TestingHost.app/..., but the product name/reference is now TestingHost_SwiftUI.app (and potentially TestingHost_OpenSwiftUI.app in OpenSwiftUI configs). This looks like it would prevent the UI tests from finding/launching the host app.
Severity: high
Other Locations
Example/Example.xcodeproj/project.pbxproj:1107Example/Example.xcodeproj/project.pbxproj:1127Example/Example.xcodeproj/project.pbxproj:1147Example/Example.xcodeproj/project.pbxproj:1167
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #780 +/- ##
===========================================
+ Coverage 13.14% 26.21% +13.06%
===========================================
Files 619 649 +30
Lines 36745 40204 +3459
===========================================
+ Hits 4829 10538 +5709
+ Misses 31916 29666 -2250 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
OPENSWIFTUI_TARGET_BUNDLE_IDin shared basic configs (OpenSwiftUI/SwiftUI)PRODUCT_BUNDLE_IDENTIFIERfrom pbxproj to target xcconfig files using the shared variablePRODUCT_NAMEtocommon.xcconfigas$(TARGET_NAME)_$(OPENSWIFTUI_TARGET_BUNDLE_ID)INFOPLIST_KEY_CFBundleDisplayNameas$(TARGET_NAME) ($(OPENSWIFTUI_TARGET_BUNDLE_ID))