flutter icon indicating copy to clipboard operation
flutter copied to clipboard

☂️ Add Swift Package Manager compatibility

Open vashworth opened this issue 2 years ago • 8 comments
trafficstars

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_mac test for Swift Package Manager
      • [ ] Update build_ios_framework_module_test test for Swift Package Manager
  • [ ] [tool] https://github.com/flutter/flutter/issues/146957
    • [ ] [tool] https://github.com/flutter/flutter/issues/81867 (also macOS)
    • [ ] [too] Ensure flutter build ios-framework works 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)
  • [ ] 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
  • [ ] [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 !.gitkeep in .gitignore)

Resources

Design doc: flutter.dev/go/swift-package-manager-plugins-v2 Original Github Issue: https://github.com/flutter/flutter/issues/33850

vashworth avatar May 03 '23 20:05 vashworth

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

renanyoy avatar Oct 08 '23 00:10 renanyoy

Would be nice to support spm for linux, windows and android targets too.

renanyoy avatar Oct 12 '23 09:10 renanyoy

@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.

stuartmorgan-g avatar Oct 12 '23 09:10 stuartmorgan-g

I am all for it :D

dawid-niedzwiecki avatar Oct 16 '23 13:10 dawid-niedzwiecki

Any news on this ? We would be happy to move from cocoapods.

danysz avatar Nov 05 '23 13:11 danysz

@stuartmorgan , I have opened a new issue to handle it #139563

renanyoy avatar Dec 05 '23 14:12 renanyoy

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.

importRyan avatar Jul 06 '24 02:07 importRyan

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

trivikr avatar Aug 14 '24 20:08 trivikr