Skip to content

feat(desktop_multi_window): add Swift Package Manager support for macOS#482

Open
tomassasovsky wants to merge 1 commit into
MixinNetwork:mainfrom
tomassasovsky:feat/desktop-multi-window-spm-macos
Open

feat(desktop_multi_window): add Swift Package Manager support for macOS#482
tomassasovsky wants to merge 1 commit into
MixinNetwork:mainfrom
tomassasovsky:feat/desktop-multi-window-spm-macos

Conversation

@tomassasovsky

Copy link
Copy Markdown

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:

The following plugins do not support Swift Package Manager for macos:

  • desktop_multi_window
    This will become an error in a future version of Flutter.

How

Follows the standard Flutter plugin SPM layout (same shape as the first-party *_foundation plugins):

  • Move macos/Classes/*.swiftmacos/desktop_multi_window/Sources/desktop_multi_window/.
  • Add macos/desktop_multi_window/Package.swift (swift-tools-version: 5.9, platforms: [.macOS("10.11")], matching the podspec's deployment target).
  • Repoint the podspec's source_files at 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

  • With 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 for desktop_multi_window is gone.
  • In a separate SPM-based host app, Flutter reports desktop_multi_window as a Swift Package.

Notes

  • Bumped to 0.3.1 + a CHANGELOG entry; happy to adjust the version to whatever you prefer.

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