flutter
flutter copied to clipboard
☂️ Add Swift Package Manager compatibility
Work items
Add Swift Package Manager compatibility
- [x] https://github.com/flutter/flutter/issues/126016
- [x] [tool] https://github.com/flutter/flutter/issues/146369
- [x] [tool] https://github.com/flutter/flutter/issues/146371
- [x] [packages] https://github.com/flutter/flutter/issues/146901
- [ ] [tool] Link to website instructions via tool once instructions are published
- [x] [tool][packages] https://github.com/flutter/flutter/issues/148018
- [x] #153448
- [ ] #153449
- [ ] https://github.com/flutter/flutter/issues/151567
- Blocker: update tests that fail if Swift Package Manager is enabled
- [ ] Update
plugin_lint_mactest for Swift Package Manager - [ ] Update
build_ios_framework_module_testtest for Swift Package Manager
- [ ] Update
- Blocker: update tests that fail if Swift Package Manager is enabled
- [ ] [tool] https://github.com/flutter/flutter/issues/146957
- [ ] [tool] https://github.com/flutter/flutter/issues/81867 (also macOS)
- [ ] [too] Ensure
flutter build ios-frameworkworks as expected on non-modules if SwiftPM is enabled - [ ] https://github.com/flutter/flutter/issues/157391
- [ ] [tool] https://github.com/flutter/flutter/issues/151504
- [ ] [tool] Make SwiftPM available on beta/stable
- [ ] [tool] Default SwiftPM opt-in flag to true
- [ ] [packages] https://github.com/flutter/flutter/issues/148021
- [ ] [tool] https://github.com/flutter/flutter/issues/144582
Website docs:
- [x] Document how to migrate a Flutter app to use Swift Package Manager
- [x] Document how to add Swift Package Manager support to a plugin
- [x] https://github.com/flutter/flutter/issues/152276
- [ ] #153792
- [ ] Update https://docs.flutter.dev/packages-and-plugins/developing-packages
- [ ] Provide instructions on how to get started with writing a Package.swift?
- [ ] Update https://docs.flutter.dev/get-started/flutter-for/uikit-devs#managing-dependencies
- [ ] Update: https://docs.flutter.dev/platform-integration/ios/ios-app-clip#step-8-integrate-plugins
Additional features:
- [ ] [tool] https://github.com/flutter/flutter/issues/146203
Migrate plugins to Swift Package Manager
- [ ] [packages] https://github.com/flutter/flutter/issues/146922
- [ ] Dogfood the migration docs with Google plugin authors
- [x] Ask
flutter-insiders@to try out the migration docs - [ ] Dogfood the migration docs with the top 5 most popular Flutter iOS/macOS plugins
- [ ] Open GitHub issues on the top 100 most popular Flutter iOS/macOS plugins
- [ ] Add a banner to the docs website with a link to the docs:
OS plugin authors: Consider upgrading your iOS plugins to also support Swift Package Manager - [ ] [tool] https://github.com/flutter/flutter/issues/147602
- [ ] [tool] https://github.com/flutter/flutter/issues/149855
- [ ] [tool] https://github.com/flutter/flutter/issues/148222
- [ ] https://github.com/flutter/flutter/issues/152038
- [x] https://github.com/dart-lang/pana/issues/1402
- [ ] Deprecate CocoaPods
- [ ] Add warning in tool if project has CocoaPods plugins
- [ ] Announce on flutter-announce@ and on the #announcements Discord channel
- [ ] [tool][packages] Remove CocoaPods support once the ecosystem has migrated to SwiftPM
- [ ] [packages] Consider re-adding SwiftPM
.modulemaps(see https://github.com/flutter/flutter/issues/148572#issuecomment-2231296570)
- [ ] [packages] Consider re-adding SwiftPM
- [ ] Close issues related to CocoaPods
- [ ] https://github.com/flutter/flutter/issues/40135
- [x] https://github.com/flutter/flutter/issues/22998
macOS
- [ ] [tool] https://github.com/flutter/flutter/issues/144397
- Common SwiftPM errors are not currently parsed for macOS due to this issue. Once resolved, we should parse for common errors same as iOS
- [ ] [tool] https://github.com/flutter/flutter/issues/146204
- Needed to set the correct
Package.swiftminimum supported platform version. Unblocks migrating:- Firebase packages
google_sign_in_ios
- Needed to set the correct
- [ ] [website] https://github.com/flutter/website/issues/7225
Bugs
- [ ] https://github.com/flutter/flutter/issues/148424
- [x] [tool] https://github.com/flutter/flutter/issues/144244
- [x] https://github.com/flutter/flutter/issues/148572
- [x] https://github.com/flutter/flutter/issues/148307
- [x] https://github.com/flutter/flutter/issues/147587
- [x] https://github.com/dart-lang/pub/issues/4262
- Workaround in documentation (using
!.gitkeepin.gitignore)
- Workaround in documentation (using
Resources
Design doc: flutter.dev/go/swift-package-manager-plugins-v2 Original Github Issue: https://github.com/flutter/flutter/issues/33850
would be nice to to do it quicly, as it feels like it's the end of cocoapods.. tons of dead repos there... also I have all my old swift libraries on spm.. really annoying to port them to cocoapod, just for flutter..
something that could help the transition https://github.com/CocoaPods/CocoaPods/issues/11942
Would be nice to support spm for linux, windows and android targets too.
@renanyoy Flutter does not support Swift as a language for any of those platforms. If you want to propose new supported languages that would need to be a new issue.
I am all for it :D
Any news on this ? We would be happy to move from cocoapods.
@stuartmorgan , I have opened a new issue to handle it #139563
This is exciting work. Please consider in the migration path that SPM will ignore architecture exclusions when a scheme includes "debug" or "development" in its name. Flutter requires "Debug" as a prefix.
Updates from @orta of the CocoaPods team:
TLDR: We're still keeping it ticking, but we're being more up-front that CocoaPods is in maintenance mode.
If CocoaPods' only audience were native Cocoa developers, CocoaPods' usage should be on the decline, however, that is not the case. The popularity of React Native and Flutter have ensured that most metrics of usage/traffic have been steadily rising over time.
Q: I use CocoaPods as a Hidden Abstraction in My Framework A: E.g. I maintain Unity, React Native, Flutter etc. A lot of these projects will (and should) be migrating to Swift Package Manager with time.
Sources:
- https://blog.cocoapods.org/CocoaPods-Support-Plans/
- https://x.com/orta/status/1823302734423965845