Repository navigation
Add Swift Package Manager support (follow-up to #60) - #65
Merged
Merged
Conversation
The target was named flutter-wallet-card, which is not a valid Swift module name and does not match Sources/flutter_wallet_card. Follow Flutter's plugin template: package and target use the plugin name, the library product uses the hyphenated name.
Leftover from the automatic SPM migration. The plugin local override (../../ios/flutter_wallet_card) and FlutterFramework references added by Flutter are kept.
Once migrated, the example app cannot be built with SPM disabled (same as the example generated by flutter create -t plugin), so Podfile.template is removed. The CocoaPods integration is checked by building a new app that depends on the plugin with SPM disabled. Both flows are documented in the example README.
Owner
|
Approving workflows. when the tests will be green, I will merge this PR. |
The SDK constraint bump to ^3.12.0 enables the tall formatter style, so CI's dart format check failed on the existing code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pub publish --dry-run warns on caret constraints for the Flutter SDK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Flutter 3.44 rejects Gradle < 8.7. Also pin Kotlin's JVM target to 17 to match the Java compile options. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GregoryPardini
force-pushed
the
spm-support
branch
from
October 6, 2026 12:25
75b39be to
599597e
Compare
Contributor
Author
|
Thanks! The previous run failed on four jobs. I've pushed fixes for all of them:
I checked these jobs locally with Flutter 3.44.0. Could you approve the workflow run again? Thanks! |
Owner
|
thanks to both @GregoryPardini and @CanadianN1nj4. |
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.
Supersedes #60. This keeps all of @CanadianN1nj4's commits and adds fixes for the points in the review from July 6.
Review points
1–2.
Package.swifttarget and module name. The package and target are now namedflutter_wallet_card, which matchesSources/flutter_wallet_cardand is a valid Swift module name. The library product keeps the hyphenated nameflutter-wallet-card. This follows Flutter's plugin template (flutter_tools/templates/plugin_swift_package_manager/ios.tmpl/.../Package.swift.tmpl).3.
FlutterFrameworkproduct vsimport Flutter. No change was needed. Flutter's plugin template links.product(name: "FlutterFramework", package: "FlutterFramework"), and that product provides theFluttermodule. The SPM build below compilesimport Flutterwithout errors.4. Stale
../../ios/my_pluginreference. Removed from the example Xcode project. The78DABEA2…(../../ios/flutter_wallet_card) and78466649…(FlutterFramework) references stay, because Flutter's SPM migration adds them on purpose for plugin examples (swift_package_manager_integration_migration.dart).5. CocoaPods path.
Package.swift.xcodebuildfails to resolve../FlutterFrameworkfor the local plugin override. A freshflutter create -t pluginexample fails the same way, so this is how Flutter behaves and not something specific to this plugin.Podfile.templateis therefore removed, and the example README no longer says that renaming it enables CocoaPods.test-ios, and the example README documents both flows.Verification (Flutter 3.47.5, Xcode, iOS simulator and device build)
flutter build ios --no-codesigninexample/passes. The plugin is built as a Swift package (flutter_wallet_card.swiftmodule), andPodfile.lockonly containsFlutter.Podfile.lockcontainsflutter_wallet_cardandOpenSSL-Universal.Side note (not in this PR)
FlutterWalletCardPlugin.swiftonly importsFlutter,PassKitandUIKit, so the OpenSSL dependency (OpenSSL-Packagein SPM,OpenSSL-Universalin the podspec) looks unused on iOS. If you agree, I can remove it in a follow-up PR.🤖 Generated with Claude Code