From e15696187b7abeecc9f38f78e1ce8ae52f6943f0 Mon Sep 17 00:00:00 2001 From: Ellet Date: Sat, 23 Nov 2024 18:29:20 +0300 Subject: [PATCH 01/11] chore: fix CocoaPods warnings running 'pod lib lint gal.podspec' --- darwin/gal.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/darwin/gal.podspec b/darwin/gal.podspec index 6f10d202..618bf9ef 100644 --- a/darwin/gal.podspec +++ b/darwin/gal.podspec @@ -7,9 +7,9 @@ Pod::Spec.new do |s| s.version = '1.0.0' s.summary = 'Flutter plugin for handle native gallary apps.' s.homepage = 'https://github.com/natsuk4ze/gal' - s.license = { :file => '../LICENSE' } + s.license = { :type => 'BSD-3-Clause', :file => '../LICENSE' } s.author = { 'Midori Design Studio' => 'https://midoridesign.studio' } - s.source = { :path => '.' } + s.source = { :http => 'https://github.com/natsuk4ze/gal' } s.source_files = 'Classes/**/*' s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' From d02840d8ebf002dfd0a8cbd6193d7ad02fced6c6 Mon Sep 17 00:00:00 2001 From: Ellet Date: Sat, 23 Nov 2024 18:34:06 +0300 Subject: [PATCH 02/11] feat: adds support for SPM --- darwin/Assets/.gitkeep | 0 darwin/gal.podspec | 3 ++- darwin/gal/Package.swift | 25 +++++++++++++++++++ .../Sources/gal}/GalPlugin.swift | 0 darwin/gal/Sources/gal/PrivacyInfo.xcprivacy | 14 +++++++++++ 5 files changed, 41 insertions(+), 1 deletion(-) delete mode 100644 darwin/Assets/.gitkeep create mode 100644 darwin/gal/Package.swift rename darwin/{Classes => gal/Sources/gal}/GalPlugin.swift (100%) create mode 100644 darwin/gal/Sources/gal/PrivacyInfo.xcprivacy diff --git a/darwin/Assets/.gitkeep b/darwin/Assets/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/darwin/gal.podspec b/darwin/gal.podspec index 618bf9ef..a61bd2c6 100644 --- a/darwin/gal.podspec +++ b/darwin/gal.podspec @@ -10,7 +10,8 @@ Pod::Spec.new do |s| s.license = { :type => 'BSD-3-Clause', :file => '../LICENSE' } s.author = { 'Midori Design Studio' => 'https://midoridesign.studio' } s.source = { :http => 'https://github.com/natsuk4ze/gal' } - s.source_files = 'Classes/**/*' + s.source_files = 'gal/Sources/gal/**/*.swift' + s.resource_bundles = {'gal_privacy' => ['gal/Sources/gal/PrivacyInfo.xcprivacy']} s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' s.ios.deployment_target = '11.0' diff --git a/darwin/gal/Package.swift b/darwin/gal/Package.swift new file mode 100644 index 00000000..730fedf1 --- /dev/null +++ b/darwin/gal/Package.swift @@ -0,0 +1,25 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "gal", + platforms: [ + .iOS("11.0"), + .macOS("11.0") + ], + products: [ + .library(name: "gal", targets: ["gal"]) + ], + dependencies: [], + targets: [ + .target( + name: "gal", + dependencies: [], + resources: [ + .process("PrivacyInfo.xcprivacy"), + ] + ) + ] +) \ No newline at end of file diff --git a/darwin/Classes/GalPlugin.swift b/darwin/gal/Sources/gal/GalPlugin.swift similarity index 100% rename from darwin/Classes/GalPlugin.swift rename to darwin/gal/Sources/gal/GalPlugin.swift diff --git a/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy b/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..0eca193e --- /dev/null +++ b/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy @@ -0,0 +1,14 @@ + + + + + NSPrivacyTrackingDomains + + NSPrivacyAccessedAPITypes + + NSPrivacyCollectedDataTypes + + NSPrivacyTracking + + + \ No newline at end of file From a5fc7fabcfc1736cfc2264532ef5cb6a8363c0c8 Mon Sep 17 00:00:00 2001 From: Ellet Date: Sat, 23 Nov 2024 18:36:22 +0300 Subject: [PATCH 03/11] chore(example): updates the example using 'flutter run -d macos' (automated) --- example/macos/Podfile.lock | 9 +--- .../macos/Runner.xcodeproj/project.pbxproj | 42 ++++++++++--------- .../xcshareddata/xcschemes/Runner.xcscheme | 21 +++++++++- example/macos/Runner/AppDelegate.swift | 6 ++- 4 files changed, 49 insertions(+), 29 deletions(-) diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index a12e31bb..5c6e8b7b 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -1,23 +1,16 @@ PODS: - FlutterMacOS (1.0.0) - - gal (1.0.0): - - Flutter - - FlutterMacOS DEPENDENCIES: - FlutterMacOS (from `Flutter/ephemeral`) - - gal (from `Flutter/ephemeral/.symlinks/plugins/gal/darwin`) EXTERNAL SOURCES: FlutterMacOS: :path: Flutter/ephemeral - gal: - :path: Flutter/ephemeral/.symlinks/plugins/gal/darwin SPEC CHECKSUMS: FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 - gal: 61e868295d28fe67ffa297fae6dacebf56fd53e1 PODFILE CHECKSUM: 23282d8bcd3669427c3011c3d9efa633cc463571 -COCOAPODS: 1.12.1 +COCOAPODS: 1.16.2 diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj index e13dce4d..a0c0f877 100644 --- a/example/macos/Runner.xcodeproj/project.pbxproj +++ b/example/macos/Runner.xcodeproj/project.pbxproj @@ -26,6 +26,7 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 8A82197E86D4414808DEC9DB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9974680D560E534269163590 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ @@ -81,6 +82,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, 8A82197E86D4414808DEC9DB /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -185,7 +187,6 @@ 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 946F29F25F8DEA27AFBEC3E4 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -193,6 +194,9 @@ 33CC11202044C79F0003C045 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 33CC10ED2044A3C60003C045 /* example.app */; productType = "com.apple.product-type.application"; @@ -204,7 +208,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { @@ -232,6 +236,9 @@ Base, ); mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -317,23 +324,6 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 946F29F25F8DEA27AFBEC3E4 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -637,6 +627,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 397f3d33..ee5d00fc 100644 --- a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,10 +1,28 @@ + + + + + + + + + + diff --git a/example/macos/Runner/AppDelegate.swift b/example/macos/Runner/AppDelegate.swift index d53ef643..b3c17614 100644 --- a/example/macos/Runner/AppDelegate.swift +++ b/example/macos/Runner/AppDelegate.swift @@ -1,9 +1,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } From e177ef12aa0e44a081fda6bfa737f906816a2965 Mon Sep 17 00:00:00 2001 From: Ellet Date: Sat, 23 Nov 2024 18:40:56 +0300 Subject: [PATCH 04/11] chore: updates .gitignore to reflect the change --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index cb6bcca2..18f42f94 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,8 @@ Flutter.podspec Generated.xcconfig flutter_export_environment.sh GeneratedPluginRegistrant.* +.build/ +.swiftpm/ # Windows related *.suo From bd1f24db167bfc0b9f9f2535a30b72eb55981598 Mon Sep 17 00:00:00 2001 From: Ellet Date: Sun, 24 Nov 2024 11:38:40 +0300 Subject: [PATCH 05/11] chore: remove the trailing comma in Package.swift to fix CI failure --- darwin/gal/Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwin/gal/Package.swift b/darwin/gal/Package.swift index 730fedf1..96ac779c 100644 --- a/darwin/gal/Package.swift +++ b/darwin/gal/Package.swift @@ -18,7 +18,7 @@ let package = Package( name: "gal", dependencies: [], resources: [ - .process("PrivacyInfo.xcprivacy"), + .process("PrivacyInfo.xcprivacy") ] ) ] From 74451cfe69e46bd33741a1dc006c9242a284920f Mon Sep 17 00:00:00 2001 From: Ellet Date: Sun, 24 Nov 2024 11:41:42 +0300 Subject: [PATCH 06/11] chore: new line at the end of the file Package.swift --- darwin/gal/Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darwin/gal/Package.swift b/darwin/gal/Package.swift index 96ac779c..b3d37a24 100644 --- a/darwin/gal/Package.swift +++ b/darwin/gal/Package.swift @@ -22,4 +22,4 @@ let package = Package( ] ) ] -) \ No newline at end of file +) From 83f710dd80ff43b823fb69f532d49cb5f17c2c06 Mon Sep 17 00:00:00 2001 From: Ellet Date: Sun, 24 Nov 2024 12:22:18 +0300 Subject: [PATCH 07/11] chore: removes PrivacyInfo.xcprivacy due to https://github.com/natsuk4ze/gal/issues/218 --- darwin/gal.podspec | 1 - darwin/gal/Package.swift | 4 +--- darwin/gal/Sources/gal/PrivacyInfo.xcprivacy | 14 -------------- 3 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 darwin/gal/Sources/gal/PrivacyInfo.xcprivacy diff --git a/darwin/gal.podspec b/darwin/gal.podspec index a61bd2c6..e2fad25c 100644 --- a/darwin/gal.podspec +++ b/darwin/gal.podspec @@ -11,7 +11,6 @@ Pod::Spec.new do |s| s.author = { 'Midori Design Studio' => 'https://midoridesign.studio' } s.source = { :http => 'https://github.com/natsuk4ze/gal' } s.source_files = 'gal/Sources/gal/**/*.swift' - s.resource_bundles = {'gal_privacy' => ['gal/Sources/gal/PrivacyInfo.xcprivacy']} s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' s.ios.deployment_target = '11.0' diff --git a/darwin/gal/Package.swift b/darwin/gal/Package.swift index b3d37a24..c50b187b 100644 --- a/darwin/gal/Package.swift +++ b/darwin/gal/Package.swift @@ -17,9 +17,7 @@ let package = Package( .target( name: "gal", dependencies: [], - resources: [ - .process("PrivacyInfo.xcprivacy") - ] + resources: [] ) ] ) diff --git a/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy b/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy deleted file mode 100644 index 0eca193e..00000000 --- a/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy +++ /dev/null @@ -1,14 +0,0 @@ - - - - - NSPrivacyTrackingDomains - - NSPrivacyAccessedAPITypes - - NSPrivacyCollectedDataTypes - - NSPrivacyTracking - - - \ No newline at end of file From aa4ab5bdb90047c3a234f065cd377832ff2d03f4 Mon Sep 17 00:00:00 2001 From: Ellet Date: Sun, 24 Nov 2024 12:33:21 +0300 Subject: [PATCH 08/11] Revert "chore: removes PrivacyInfo.xcprivacy due to https://github.com/natsuk4ze/gal/issues/218" This reverts commit 83f710dd80ff43b823fb69f532d49cb5f17c2c06. --- darwin/gal.podspec | 1 + darwin/gal/Package.swift | 4 +++- darwin/gal/Sources/gal/PrivacyInfo.xcprivacy | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 darwin/gal/Sources/gal/PrivacyInfo.xcprivacy diff --git a/darwin/gal.podspec b/darwin/gal.podspec index e2fad25c..a61bd2c6 100644 --- a/darwin/gal.podspec +++ b/darwin/gal.podspec @@ -11,6 +11,7 @@ Pod::Spec.new do |s| s.author = { 'Midori Design Studio' => 'https://midoridesign.studio' } s.source = { :http => 'https://github.com/natsuk4ze/gal' } s.source_files = 'gal/Sources/gal/**/*.swift' + s.resource_bundles = {'gal_privacy' => ['gal/Sources/gal/PrivacyInfo.xcprivacy']} s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' s.ios.deployment_target = '11.0' diff --git a/darwin/gal/Package.swift b/darwin/gal/Package.swift index c50b187b..b3d37a24 100644 --- a/darwin/gal/Package.swift +++ b/darwin/gal/Package.swift @@ -17,7 +17,9 @@ let package = Package( .target( name: "gal", dependencies: [], - resources: [] + resources: [ + .process("PrivacyInfo.xcprivacy") + ] ) ] ) diff --git a/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy b/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..0eca193e --- /dev/null +++ b/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy @@ -0,0 +1,14 @@ + + + + + NSPrivacyTrackingDomains + + NSPrivacyAccessedAPITypes + + NSPrivacyCollectedDataTypes + + NSPrivacyTracking + + + \ No newline at end of file From 0cd0096b60a3aa1fdc5124d519da1f3968a31e7c Mon Sep 17 00:00:00 2001 From: Ellet Date: Sun, 24 Nov 2024 15:32:47 +0300 Subject: [PATCH 09/11] chore: new line at the end of Package.swift --- darwin/gal/Package.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/darwin/gal/Package.swift b/darwin/gal/Package.swift index b3d37a24..702ccc0d 100644 --- a/darwin/gal/Package.swift +++ b/darwin/gal/Package.swift @@ -23,3 +23,4 @@ let package = Package( ) ] ) + From 40dfe39b8552367de221ca82c8c76ef4e8ae9b9a Mon Sep 17 00:00:00 2001 From: Ellet Date: Sun, 24 Nov 2024 15:40:45 +0300 Subject: [PATCH 10/11] chore: one empty line at the end of Package.swift --- darwin/gal/Package.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/darwin/gal/Package.swift b/darwin/gal/Package.swift index 702ccc0d..b3d37a24 100644 --- a/darwin/gal/Package.swift +++ b/darwin/gal/Package.swift @@ -23,4 +23,3 @@ let package = Package( ) ] ) - From 619cfc91b82a27456853ccf4b2bfe6f92c5b254a Mon Sep 17 00:00:00 2001 From: Yu / Midori Date: Sat, 30 Nov 2024 22:20:06 +0900 Subject: [PATCH 11/11] Revert "chore: one empty line at the end of Package.swift" This reverts commit 40dfe39b8552367de221ca82c8c76ef4e8ae9b9a. --- darwin/gal/Package.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/darwin/gal/Package.swift b/darwin/gal/Package.swift index b3d37a24..702ccc0d 100644 --- a/darwin/gal/Package.swift +++ b/darwin/gal/Package.swift @@ -23,3 +23,4 @@ let package = Package( ) ] ) +