Migrate iOS plugin to Swift Package Manager#28
Open
elitree wants to merge 1 commit into
Open
Conversation
|
Hello when this will be published to pub dev....? |
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.
Context
CocoaPods is entering maintenance mode toward the end of the year, and Flutter now provides first-class Swift Package Manager support along with documentation for plugin authors on migrating. This PR adopts SPM ahead of that transition so the plugin keeps working smoothly as the ecosystem moves off CocoaPods.
Summary
Adds Swift Package Manager (SPM) support to the iOS plugin following Flutter's recommended dual-support approach — the plugin now ships an SPM package and keeps a working podspec, so it builds whether or not the consuming app has SPM enabled. No breaking changes for existing CocoaPods users.
Changes
Plugin
git mv):ios/Classes/OpenFilePlugin.m→ios/open_filex/Sources/open_filex/OpenFilePlugin.mios/Classes/OpenFilePlugin.h→ios/open_filex/Sources/open_filex/include/open_filex/OpenFilePlugin.h(public headers underinclude/)ios/open_filex/Package.swift— Objective-C target with.headerSearchPath("include/open_filex"),swift-tools-version: 5.9ios/open_filex.podspecto pointsource_files/public_header_filesat the new paths (CocoaPods still works)8.0→13.0(Flutter's current enforced minimum).build/toios/.gitignoreExample app
FlutterGeneratedPluginSwiftPackagereference and deployment target → 13.0.gitignoregained.build/and.swiftpm/AppDelegate.swift,Info.plist) that Flutter applies on build — kept intentionally so the example builds cleanly on current FlutterTesting
flutter build ios --simulator --no-codesignpasses with Swift Package Manager enabled; build log confirms "Adding Swift Package Manager integration" and the plugin resolves throughPackage.swift.