From 3aec6219ceb09412bcb2f3b6eec7c9595f34fb73 Mon Sep 17 00:00:00 2001 From: goodspb Date: Sun, 21 Jun 2026 14:44:53 +0800 Subject: [PATCH] feat: add Swift Package Manager support for macOS - Add macos/local_notifier/Package.swift with FlutterFramework dependency - Move Swift sources from macos/Classes/ to macos/local_notifier/Classes/ - Update podspec source_files path to match new structure - Add **/.build/ to .gitignore --- .gitignore | 1 + macos/local_notifier.podspec | 2 +- .../Classes/LocalNotifierPlugin.swift | 0 macos/local_notifier/Package.swift | 24 +++++++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) rename macos/{ => local_notifier}/Classes/LocalNotifierPlugin.swift (100%) create mode 100644 macos/local_notifier/Package.swift diff --git a/.gitignore b/.gitignore index ac5aa98..fce5f04 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ migrate_working_dir/ **/doc/api/ .dart_tool/ build/ +**/.build/ diff --git a/macos/local_notifier.podspec b/macos/local_notifier.podspec index ad6d75e..81852b1 100644 --- a/macos/local_notifier.podspec +++ b/macos/local_notifier.podspec @@ -13,7 +13,7 @@ A new flutter plugin project. s.license = { :file => '../LICENSE' } s.author = { 'LiJianying' => 'lijy91@foxmail.com' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' + s.source_files = 'local_notifier/Classes/**/*' s.dependency 'FlutterMacOS' s.platform = :osx, '10.11' diff --git a/macos/Classes/LocalNotifierPlugin.swift b/macos/local_notifier/Classes/LocalNotifierPlugin.swift similarity index 100% rename from macos/Classes/LocalNotifierPlugin.swift rename to macos/local_notifier/Classes/LocalNotifierPlugin.swift diff --git a/macos/local_notifier/Package.swift b/macos/local_notifier/Package.swift new file mode 100644 index 0000000..635177b --- /dev/null +++ b/macos/local_notifier/Package.swift @@ -0,0 +1,24 @@ +// swift-tools-version: 5.9 +import PackageDescription + +let package = Package( + name: "local_notifier", + platforms: [ + .macOS("10.14") + ], + products: [ + .library(name: "local-notifier", targets: ["local_notifier"]) + ], + dependencies: [ + .package(name: "FlutterFramework", path: "../FlutterFramework") + ], + targets: [ + .target( + name: "local_notifier", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework") + ], + path: "Classes" + ) + ] +)