feat(cli): support SPM package traits in generated Package.swift#8351
feat(cli): support SPM package traits in generated Package.swift#8351robingenz wants to merge 5 commits intoionic-team:mainfrom
Conversation
|
Hey @robingenz thanks for the PR, tested here and it's working pretty well. I did a few minor changes, most notably to allow to set the I'll ask for an additional review of the team as well. For reference - Tested with https://github.com/OS-pedrogustavobilro/test-capacitor-pr8351-spm-traits |
|
@OS-pedrogustavobilro Thank you so much! We are really looking forward to the release as we have 2-3 plugins that are just waiting for it. Let me know if I can help in any way. |
|
Since the feature requires swift-tools-version: 6.1, even if that version will only be used if traits are present, I would prefer not merging this until Capacitor uses Swift 6. My understanding is that having swift-tools-version: 6.1 in the Package.swift has implications for the dependencies being fetched and could cause issues if some of the dependencies have xcframeworks built with previous versions |
|
@jcesarmobile Good point—I totally understand the concern. Is there a timeline for Swift 6 support in Capacitor? The reason this feature is somewhat time-sensitive is that while it was supported in CocoaPods, SPM is now the default package manager. This has created restrictions for our plugin users who have transitioned to SPM. To mitigate the risk, I have two suggestions:
Let me know what you think! |
Summary
ios.spm.packageTraitsconfig option to pass package traits to SPM plugin dependenciesswift-tools-version: 6.1when traits are configured, otherwise keep5.9traits: [...]to.package()dependency lines for plugins with configured traitsClose #8335