feat(cli): Experimental config for swift-tools-version in SPM apps#8372
Open
OS-pedrogustavobilro wants to merge 3 commits intomainfrom
Open
feat(cli): Experimental config for swift-tools-version in SPM apps#8372OS-pedrogustavobilro wants to merge 3 commits intomainfrom
OS-pedrogustavobilro wants to merge 3 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Description
This PR adds a new experimental for setting
swift-tools-versionin theCapApp-SPM/Package.swiftfile. The reason why this feature is marked experimental is because Capacitor does not support Swift 6 yet, and therefore using this config to setswift-tools-versionto 6.x can cause issues for their apps, depending on the plugins the app has, their dependencies, and what Swift version they were built with.Usage example in
capacitor.config.json:Related to #8351, as a way for users to make a more conscious opt-in for Package Traits in SPM.
Testing
I've tested setting SwiftToolsVersion '6.1', and also '6.2.1' (latest in current stable Xcode version) with most official Capacitor plugins across different apps, and the apps build and plugins working without issues.
Feel free to create your own apps, point to the local version of capacitor (cli) containing this PR branch, add the experimental config, run
cap sync, build the app with Xcode and test.