feat(ios): add Swift Package Manager support#8
Merged
Conversation
Flutter is migrating to Swift Package Manager (SPM) as the default dependency manager for iOS. This adds SPM support while keeping CocoaPods compatibility, following the official migration guide. - Create ios/flutter_foreground_task/ SPM package with Package.swift - Move source files from ios/Classes/ to SPM-compliant directory layout - Update podspec source_files to point to the new paths - Add .build/ and .swiftpm/ to .gitignore Closes Dev-hwang#379
Aligns the CocoaPods deployment target with Package.swift and Flutter 3.22+'s own iOS 12.0 minimum requirement.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
ios/Classes/toios/flutter_foreground_task/Sources/flutter_foreground_task/(SPM-compliant layout)Package.swiftmanifest targeting iOS 12.0+ with ObjC bridge files excluded from the SPM targetsource_filesto point to the new paths, maintaining dual CocoaPods + SPM compatibility.build/and.swiftpm/to.gitignoreAddresses Dev-hwang/flutter_foreground_task#379 — Flutter is making SPM the default in the next stable release (3.44), and CocoaPods is now in maintenance mode.
Test plan
flutter config --no-enable-swift-package-manager && cd example && flutter runflutter config --enable-swift-package-manager && cd example && flutter runios/flutter_foreground_task/in Xcode and confirmPackage.swiftresolves without errorsflutter test