From 97bee25466e644f4557a3209f7326400f6304327 Mon Sep 17 00:00:00 2001 From: damywise <25608913+damywise@users.noreply.github.com> Date: Wed, 4 Dec 2024 05:47:42 +0700 Subject: [PATCH] Add Swift Package Manager support - Modified source files from and moved `Classes/*` to `window_manager/Sources/window_manager/*` - Added `Package.swift` --- .../macos/window_manager.podspec | 2 +- .../.build/workspace-state.json | 11 +++++++ .../macos/window_manager/Package.swift | 33 +++++++++++++++++++ .../window_manager}/WindowManager.swift | 0 .../window_manager}/WindowManagerPlugin.swift | 0 5 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 packages/window_manager/macos/window_manager/.build/workspace-state.json create mode 100644 packages/window_manager/macos/window_manager/Package.swift rename packages/window_manager/macos/{Classes => window_manager/Sources/window_manager}/WindowManager.swift (100%) rename packages/window_manager/macos/{Classes => window_manager/Sources/window_manager}/WindowManagerPlugin.swift (100%) diff --git a/packages/window_manager/macos/window_manager.podspec b/packages/window_manager/macos/window_manager.podspec index fdaa7def..72c84ea7 100644 --- a/packages/window_manager/macos/window_manager.podspec +++ b/packages/window_manager/macos/window_manager.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 = 'window_manager/Sources/window_manager/**/*' s.dependency 'FlutterMacOS' s.platform = :osx, '10.11' diff --git a/packages/window_manager/macos/window_manager/.build/workspace-state.json b/packages/window_manager/macos/window_manager/.build/workspace-state.json new file mode 100644 index 00000000..71deae90 --- /dev/null +++ b/packages/window_manager/macos/window_manager/.build/workspace-state.json @@ -0,0 +1,11 @@ +{ + "object" : { + "artifacts" : [ + + ], + "dependencies" : [ + + ] + }, + "version" : 6 +} \ No newline at end of file diff --git a/packages/window_manager/macos/window_manager/Package.swift b/packages/window_manager/macos/window_manager/Package.swift new file mode 100644 index 00000000..17de7a02 --- /dev/null +++ b/packages/window_manager/macos/window_manager/Package.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.39 +import PackageDescription + +let package = Package( + name: "window_manager", + platforms: [ + .macOS(.v10_11) + ], + products: [ + .library( + name: "window_manager", + targets: ["window_manager"] + ) + ], + dependencies: [], + targets: [ + .target( + name: "window_manager", + dependencies: [], + resources: [ + // If your plugin requires a privacy manifest, for example if it collects user + // data, update the PrivacyInfo.xcprivacy file to describe your plugin's + // privacy impact, and then uncomment these lines. For more information, see + // https://developer.apple.com/documentation/bundleresources/privacy_manifest_files + // .process("PrivacyInfo.xcprivacy"), + + // If you have other resources that need to be bundled with your plugin, refer to + // the following instructions to add them: + // https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package + ] + ) + ] +) diff --git a/packages/window_manager/macos/Classes/WindowManager.swift b/packages/window_manager/macos/window_manager/Sources/window_manager/WindowManager.swift similarity index 100% rename from packages/window_manager/macos/Classes/WindowManager.swift rename to packages/window_manager/macos/window_manager/Sources/window_manager/WindowManager.swift diff --git a/packages/window_manager/macos/Classes/WindowManagerPlugin.swift b/packages/window_manager/macos/window_manager/Sources/window_manager/WindowManagerPlugin.swift similarity index 100% rename from packages/window_manager/macos/Classes/WindowManagerPlugin.swift rename to packages/window_manager/macos/window_manager/Sources/window_manager/WindowManagerPlugin.swift