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

Add Swift Package Manager Support #1683

Conversation

alejandro-all-win-software
Copy link
Contributor

DESCRIPTION

  • Added support for Swift Package Manager for compatibility with new projects.
  • Updated example minimum iOS version.
  • Updated podspec.
  • Added missing imports
  • Fixes Add Swift Package Manager support #1582

Copy link
Collaborator

@navaronbracke navaronbracke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks okay to me.

I wonder if we should move this to version 8.2.0 instead?

ios/file_picker/Package.swift Outdated Show resolved Hide resolved
ios/file_picker/Package.swift Outdated Show resolved Hide resolved
@navaronbracke
Copy link
Collaborator

@alejandro-all-win-software fyi: I did a fix-forward for the merge conflict. We landed a MacOS change a few moments ago, so it was giving a small issue with versioning.

@navaronbracke
Copy link
Collaborator

@alejandro-all-win-software Once the branch in the Package.swift is updated, I'll test this locally and then this looks good to release. Thank you!

@alejandro-all-win-software
Copy link
Contributor Author

@navaronbracke I also updated the macOS implementation to support SPM

@navaronbracke
Copy link
Collaborator

@alejandro-all-win-software While preparing to test this locally, I also saw this in my terminal:

All plugins found for ios are Swift Packages, but your project still has CocoaPods integration. Your project uses a non-standard Podfile and will
need to be migrated to Swift Package Manager manually. Some steps you may need to complete include:
  * In the ios/ directory run "pod deintegrate"
  * Transition any Pod dependencies to Swift Package equivalents. See
  https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app
  * Transition any custom logic
  * Remove the include to "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" in your ios/Flutter/Debug.xcconfig
  * Remove the include to "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" in your ios/Flutter/Release.xcconfig

Removing CocoaPods integration will improve the project's build time.
All plugins found for macos are Swift Packages, but your project still has CocoaPods integration. To remove CocoaPods integration, complete the
following steps:
  * In the macos/ directory run "pod deintegrate"
  * Also in the macos/ directory, delete the Podfile
  * Remove the include to "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" in your macos/Flutter/Flutter-Debug.xcconfig
  * Remove the include to "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" in your macos/Flutter/Flutter-Release.xcconfig

Removing CocoaPods integration will improve the project's build time.

This is for the file_picker example app. Would you like to address this as well? The example app can run on SPM only.

@navaronbracke
Copy link
Collaborator

@alejandro-all-win-software I'll verify locally if this works in XCode (just as a sanity check) and then this is ready for a release.
Thank you!

@orestesgaolin
Copy link
Contributor

Oh, missed that! :D

You can close the #1692 in favor of it

@navaronbracke
Copy link
Collaborator

@alejandro-all-win-software This works for both iOS & MacOS, thanks!

One thing I'm not sure about, though: When opening the iOS or the MacOS example app in XCode, the Pods reference was still there under Runner in the left pane, in red text. Do you get extra diff if you remove that Pods reference from XCode?

@alejandro-all-win-software
Copy link
Contributor Author

Let me check.

@alejandro-all-win-software
Copy link
Contributor Author

Yeah, I see changes when removing them. Let me commit it.

@navaronbracke navaronbracke merged commit 83bdfc9 into miguelpruivo:master Jan 29, 2025
3 checks passed
@navaronbracke
Copy link
Collaborator

This should be available on Pub in a moment!

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.

Add Swift Package Manager support
3 participants