Skip to content

feat(cli): Experimental config for swift-tools-version in SPM apps#8372

Open
OS-pedrogustavobilro wants to merge 3 commits intomainfrom
feat/experimental-spm-swifttools
Open

feat(cli): Experimental config for swift-tools-version in SPM apps#8372
OS-pedrogustavobilro wants to merge 3 commits intomainfrom
feat/experimental-spm-swifttools

Conversation

@OS-pedrogustavobilro
Copy link
Contributor

PR Description

⚠️ AI-assisted PR with Claude, manually reviewed and verified by me.

This PR adds a new experimental for setting swift-tools-version in the CapApp-SPM/Package.swift file. The reason why this feature is marked experimental is because Capacitor does not support Swift 6 yet, and therefore using this config to set swift-tools-version to 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:

{
	// other configs...
	"experimental": {
		"ios": {
			"spm": {
				"swiftToolsVersion": "6.1"
			}
		}
	}
}

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant