Skip to content

feat(spm): add Package.swift to the Swift method-channel plugins - #1

Merged
MAUstaoglu merged 3 commits into
mainfrom
feat/spm-package-manifests
Jun 11, 2026
Merged

feat(spm): add Package.swift to the Swift method-channel plugins#1
MAUstaoglu merged 3 commits into
mainfrom
feat/spm-package-manifests

Conversation

@MAUstaoglu

Copy link
Copy Markdown
Member

Summary

Adds a tvos/Package.swift to 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_tvos
  • shared_preferences_tvos
  • connectivity_plus_tvos
  • audioplayers_tvos
  • flutter_secure_storage_tvos

Details

Each manifest:

  • declares the FlutterFramework dependency (../FlutterFramework) so the target can import Flutter — flutter-tvos generates that package as a sibling under the app's ephemeral SwiftPM packages;
  • names the library product with hyphens (e.g. path-provider-tvos) while keeping the underscored target/module name (so the generated registrant's @import path_provider_tvos resolves);
  • reuses the same Classes/ sources the podspec already compiles, so both dependency managers stay in sync from one source tree.

Plugins that ship a Package.swift are 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.

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).
Sign up for freeto 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.

1 participant

@MAUstaoglu