feat(desktop_multi_window): add Swift Package Manager support for macOS#482
Open
tomassasovsky wants to merge 1 commit into
Open
feat(desktop_multi_window): add Swift Package Manager support for macOS#482tomassasovsky wants to merge 1 commit into
tomassasovsky wants to merge 1 commit into
Conversation
Flutter is migrating macOS/iOS plugins to Swift Package Manager and warns that
desktop_multi_window doesn't support it ("This will become an error in a future
version of Flutter"). This adds SPM support alongside the existing CocoaPods
podspec, following the standard Flutter plugin layout:
- Move macos/Classes/*.swift to
macos/desktop_multi_window/Sources/desktop_multi_window/.
- Add macos/desktop_multi_window/Package.swift (swift-tools 5.9, macOS 10.11).
- Point the podspec's source_files at the new location so CocoaPods builds the
same sources (no behaviour change for existing CocoaPods consumers).
Verified: with SPM enabled, the example app builds for macOS and Flutter reports
desktop_multi_window as a Swift Package (the prior "does not support Swift
Package Manager" warning is gone).
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.
What
Adds Swift Package Manager (SPM) support for the macOS plugin, alongside the existing CocoaPods podspec.
Why
Flutter is migrating macOS/iOS plugins to Swift Package Manager. Projects that have adopted SPM currently get this warning when they depend on
desktop_multi_window:How
Follows the standard Flutter plugin SPM layout (same shape as the first-party
*_foundationplugins):macos/Classes/*.swift→macos/desktop_multi_window/Sources/desktop_multi_window/.macos/desktop_multi_window/Package.swift(swift-tools-version: 5.9,platforms: [.macOS("10.11")], matching the podspec's deployment target).source_filesat the new location so CocoaPods builds the exact same sources — no behaviour change for existing CocoaPods consumers.Linux and Windows are unaffected (they don't use SPM).
Verification
flutter config --enable-swift-package-manager, the example app builds for macOS (✓ Built ... flutter_multi_window_example.app), and the prior "does not support Swift Package Manager" warning fordesktop_multi_windowis gone.desktop_multi_windowas a Swift Package.Notes
0.3.1+ a CHANGELOG entry; happy to adjust the version to whatever you prefer.