Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Score support for swift package manager in plugins with ios/macos support #1402

Open
Tracked by #126005
sigurdm opened this issue Oct 3, 2024 · 2 comments
Open
Tracked by #126005
Labels
type-enhancement A request for a change that isn't a bug

Comments

@sigurdm
Copy link
Contributor

sigurdm commented Oct 3, 2024

Reading:
https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors#how-to-add-swift-package-manager-support-to-an-existing-flutter-plugin

As far as I can tell we need to detect the presence of a <plugin_name>/<platform>/Package.swift file. Where platform is respectively ios and macos for the two platforms, or darwin that covers both.

I suggest we do an initial zero-scoring report note as we did for wasm support:

  • If the package is an ios plugin:
    • if it has <plugin_name>/ios/Package.swift or <plugin_name>/darwin/Package.swift file, mark platform support as fully passing
    • otherwise write "in the future this will receive a reduced score, please migrate to Swift package manager (link)"
  • Similarly for macos
@sigurdm sigurdm added the type-enhancement A request for a change that isn't a bug label Oct 3, 2024
@jonasfj
Copy link
Member

jonasfj commented Oct 3, 2024

How will flutter_tool behave if there is also a podspec file? Can there be conflicts or how does it work.

Just suggesting that this might also be worth checking.

@loic-sharma
Copy link

loic-sharma commented Oct 3, 2024

... <plugin_name>/<platform>/Package.swift file

Minor correction, the Swift package manifest path is <platform>/<plugin_name>/Package.swift (where <platform> is darwin, ios, macos). The podspec path is <platform>/<plugin_name>.podspec. But otherwise this proposal sounds good to me!

How will flutter_tool behave if there is also a podspec file? Can there be conflicts or how does it work.

An iOS plugin can support both CocoaPods and Swift Package Manager at the same time. In fact, that's what we recommend:

Flutter plugins should support both Swift Package Manager and CocoaPods until further notice.

Swift Package Manager adoption will be gradual. Plugins that don't support CocoaPods won't be usable by projects that haven't migrated to Swift Package Manager yet. Plugins that don't support Swift Package Manager can cause problems for projects that have migrated.

Ideally, a plugin that supports both SwiftPM and CocoaPods shouldn't be penalized.

Please let me know if you have any other questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants