Uh oh!
There was an error while loading. Please reload this page.
feat(spm): add Package.swift to the Swift method-channel plugins - #1
Merged
Conversation
Make the clean-Swift federated plugins consumable via Swift Package Manager (Flutter 3.44 default) alongside their existing podspec. Each manifest declares the FlutterFramework dependency (so the target can import Flutter), names the library product with hyphens, and reuses the same Classes/ sources the podspec compiles. flutter-tvos picks these up automatically and skips them in the Podfile so the two never double-link. Plugins: path_provider_tvos, shared_preferences_tvos, connectivity_plus_tvos, audioplayers_tvos, flutter_secure_storage_tvos. Verified end-to-end on the simulator (method-channel round-trip) and in a release build on a physical Apple TV.
Add a CHANGELOG entry and bump version 0.0.1 -> 0.0.2 for the five plugins that gained a tvos/Package.swift, so the Swift Package Manager support can be published to pub.dev. Additive, no API or behaviour change. Plugins: path_provider_tvos, shared_preferences_tvos, connectivity_plus_tvos, audioplayers_tvos, flutter_secure_storage_tvos.
Add a 'Dependency management' note to the five SPM-enabled plugin READMEs (both Swift Package Manager and CocoaPods are supported, wired automatically by flutter-tvos) and bump the usage example from ^0.0.1 to ^0.0.2 so the constraint actually picks up the SPM-enabled release (Dart caret ^0.0.1 resolves to <0.0.2).
12 tasks
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 freeto 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
Adds a
tvos/Package.swiftto the five Swift method-channel federated plugins so they're consumable via Swift Package Manager (the Flutter 3.44 default) alongside their existing podspec.path_provider_tvosshared_preferences_tvosconnectivity_plus_tvosaudioplayers_tvosflutter_secure_storage_tvosDetails
Each manifest:
FlutterFrameworkdependency (../FlutterFramework) so the target canimport Flutter— flutter-tvos generates that package as a sibling under the app's ephemeral SwiftPM packages;path-provider-tvos) while keeping the underscored target/module name (so the generated registrant's@import path_provider_tvosresolves);Classes/sources the podspec already compiles, so both dependency managers stay in sync from one source tree.Plugins that ship a
Package.swiftare owned by SPM; flutter-tvos's Podfile skips them, so SPM and CocoaPods never double-link.Verification
Built and run end-to-end via flutter-tvos: a method-channel round-trip works on the simulator (debug) and a release (AOT) build runs on a physical Apple TV with all five statically linked.
The ObjC/mixed plugins (sqflite, video_player, device_info, package_info, wakelock, flutter_tts) intentionally stay CocoaPods-only.