Set build settings required for Swift in the template project #2067
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please select one of the following
Summary:
As of Expo SDK50 it's possible to use Expo modules in
react-native-macos
projects. Duringpod install
and a build phase script,expo-modules-autolinking
generates a Swift file calledExpoModulesProvider.swift
and adds it programmatically to the pbxproj using CocoaPods tooling.The problem is that the template project doesn't have
SWIFT_VERSION
build setting, which causes the below error when building:If we manually add a Swift file through Xcode, it automatically adds
SWIFT_VERSION
,SWIFT_OPTIMIZATION_LEVEL
andCLANG_ENABLE_MODULES
build settings to the target. These settings are already present in the target for iOS.To made these changes, I simply manually added a dummy Swift file to the HelloWorld project and let Xcode update these settings.
Changelog:
[IOS] [CHANGED] - Set build settings required for Swift in the template project
Test Plan:
The newly generated project builds as expected (i.e. without the issue mentioned above) after applying this change and integrating it with Expo modules.