From 0fd23fa35f5600fc55a35b6366828cd06fc4ea5c Mon Sep 17 00:00:00 2001 From: charafau Date: Mon, 12 Aug 2024 16:23:48 +0900 Subject: [PATCH 1/5] add spm support for network info --- .../network_info_plus/ios/Assets/.gitkeep | 0 .../ios/network_info_plus.podspec | 6 ++--- .../ios/network_info_plus/Package.swift | 27 +++++++++++++++++++ .../FPPCaptiveNetworkInfoProvider.m | 2 +- .../FPPHotspotNetworkInfoProvider.m | 2 +- .../network_info_plus}/FPPNetworkInfo.m | 2 +- .../FPPNetworkInfoPlusPlugin.m | 12 ++++----- .../network_info_plus}/PrivacyInfo.xcprivacy | 0 .../Sources/network_info_plus}/getgateway.c | 6 ++--- .../FPPCaptiveNetworkInfoProvider.h | 0 .../FPPHotspotNetworkInfoProvider.h | 0 .../network_info_plus}/FPPNetworkInfo.h | 0 .../FPPNetworkInfoPlusPlugin.h | 0 .../FPPNetworkInfoProvider.h | 0 .../include/network_info_plus}/getgateway.h | 0 .../include/network_info_plus}/route.h | 0 16 files changed, 42 insertions(+), 15 deletions(-) delete mode 100644 packages/network_info_plus/network_info_plus/ios/Assets/.gitkeep create mode 100644 packages/network_info_plus/network_info_plus/ios/network_info_plus/Package.swift rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus}/FPPCaptiveNetworkInfoProvider.m (92%) rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus}/FPPHotspotNetworkInfoProvider.m (90%) rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus}/FPPNetworkInfo.m (79%) rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus}/FPPNetworkInfoPlusPlugin.m (93%) rename packages/network_info_plus/network_info_plus/ios/{ => network_info_plus/Sources/network_info_plus}/PrivacyInfo.xcprivacy (100%) rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus}/getgateway.c (99%) rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus/include/network_info_plus}/FPPCaptiveNetworkInfoProvider.h (100%) rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus/include/network_info_plus}/FPPHotspotNetworkInfoProvider.h (100%) rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus/include/network_info_plus}/FPPNetworkInfo.h (100%) rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus/include/network_info_plus}/FPPNetworkInfoPlusPlugin.h (100%) rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus/include/network_info_plus}/FPPNetworkInfoProvider.h (100%) rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus/include/network_info_plus}/getgateway.h (100%) rename packages/network_info_plus/network_info_plus/ios/{Classes => network_info_plus/Sources/network_info_plus/include/network_info_plus}/route.h (100%) diff --git a/packages/network_info_plus/network_info_plus/ios/Assets/.gitkeep b/packages/network_info_plus/network_info_plus/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/network_info_plus/network_info_plus/ios/network_info_plus.podspec b/packages/network_info_plus/network_info_plus/ios/network_info_plus.podspec index e8fd5d7c48..b2d4e61954 100644 --- a/packages/network_info_plus/network_info_plus/ios/network_info_plus.podspec +++ b/packages/network_info_plus/network_info_plus/ios/network_info_plus.podspec @@ -14,10 +14,10 @@ Downloaded by pub (not CocoaPods). s.author = { 'Flutter Community Team' => 'authors@fluttercommunity.dev' } s.source = { :http => 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/network_info_plus' } s.documentation_url = 'https://pub.dev/packages/network_info_plus' - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' + s.source_files = 'network_info_plus/Sources/network_info_plus/**/*.{h,m}' + s.public_header_files = 'network_info_plus/Sources/network_info_plus/include/**/*.h' s.dependency 'Flutter' s.platform = :ios, '12.0' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } - s.resource_bundles = {'network_info_plus_privacy' => ['PrivacyInfo.xcprivacy']} + s.resource_bundles = {'network_info_plus_privacy' => ['network_info_plus/Sources/network_info_plus/PrivacyInfo.xcprivacy']} end diff --git a/packages/network_info_plus/network_info_plus/ios/network_info_plus/Package.swift b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Package.swift new file mode 100644 index 0000000000..21ea676054 --- /dev/null +++ b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Package.swift @@ -0,0 +1,27 @@ +// 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: "network_info_plus", + platforms: [ + .iOS("12.0"), + ], + products: [ + .library(name: "network-info-plus", targets: ["network_info_plus"]) + ], + dependencies: [], + targets: [ + .target( + name: "network_info_plus", + dependencies: [], + resources: [ + .process("PrivacyInfo.xcprivacy"), + ], + cSettings: [ + .headerSearchPath("include/network_info_plus") + ] + ) + ] +) diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/FPPCaptiveNetworkInfoProvider.m b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPCaptiveNetworkInfoProvider.m similarity index 92% rename from packages/network_info_plus/network_info_plus/ios/Classes/FPPCaptiveNetworkInfoProvider.m rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPCaptiveNetworkInfoProvider.m index 3f6b60aef8..c97f6b38db 100644 --- a/packages/network_info_plus/network_info_plus/ios/Classes/FPPCaptiveNetworkInfoProvider.m +++ b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPCaptiveNetworkInfoProvider.m @@ -1,4 +1,4 @@ -#import "FPPCaptiveNetworkInfoProvider.h" +#import "./include/network_info_plus/FPPCaptiveNetworkInfoProvider.h" #import @implementation FPPCaptiveNetworkInfoProvider diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/FPPHotspotNetworkInfoProvider.m b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPHotspotNetworkInfoProvider.m similarity index 90% rename from packages/network_info_plus/network_info_plus/ios/Classes/FPPHotspotNetworkInfoProvider.m rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPHotspotNetworkInfoProvider.m index 578fe1b301..5365f5a529 100644 --- a/packages/network_info_plus/network_info_plus/ios/Classes/FPPHotspotNetworkInfoProvider.m +++ b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPHotspotNetworkInfoProvider.m @@ -1,4 +1,4 @@ -#import "FPPHotspotNetworkInfoProvider.h" +#import "./include/network_info_plus/FPPHotspotNetworkInfoProvider.h" #import @implementation FPPHotspotNetworkInfoProvider diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfo.m b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPNetworkInfo.m similarity index 79% rename from packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfo.m rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPNetworkInfo.m index f01dc1bc59..e8c881303d 100644 --- a/packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfo.m +++ b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPNetworkInfo.m @@ -1,4 +1,4 @@ -#import "FPPNetworkInfo.h" +#import "./include/network_info_plus/FPPNetworkInfo.h" @implementation FPPNetworkInfo diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfoPlusPlugin.m b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPNetworkInfoPlusPlugin.m similarity index 93% rename from packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfoPlusPlugin.m rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPNetworkInfoPlusPlugin.m index e2bbb2ece4..50c05e2693 100644 --- a/packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfoPlusPlugin.m +++ b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/FPPNetworkInfoPlusPlugin.m @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "FPPNetworkInfoPlusPlugin.h" +#import "./include/network_info_plus/FPPNetworkInfoPlusPlugin.h" -#import "FPPCaptiveNetworkInfoProvider.h" -#import "FPPHotspotNetworkInfoProvider.h" -#import "FPPNetworkInfo.h" -#import "FPPNetworkInfoProvider.h" +#import "./include/network_info_plus/FPPCaptiveNetworkInfoProvider.h" +#import "./include/network_info_plus/FPPHotspotNetworkInfoProvider.h" +#import "./include/network_info_plus/FPPNetworkInfo.h" +#import "./include/network_info_plus/FPPNetworkInfoProvider.h" #import "SystemConfiguration/CaptiveNetwork.h" -#import "getgateway.h" +#import "./include/network_info_plus/getgateway.h" #import #include diff --git a/packages/network_info_plus/network_info_plus/ios/PrivacyInfo.xcprivacy b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/PrivacyInfo.xcprivacy similarity index 100% rename from packages/network_info_plus/network_info_plus/ios/PrivacyInfo.xcprivacy rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/PrivacyInfo.xcprivacy diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/getgateway.c b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/getgateway.c similarity index 99% rename from packages/network_info_plus/network_info_plus/ios/Classes/getgateway.c rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/getgateway.c index f90b317081..35adb84e35 100644 --- a/packages/network_info_plus/network_info_plus/ios/Classes/getgateway.c +++ b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/getgateway.c @@ -100,14 +100,14 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include "route.h" +#include "./include/network_info_plus/route.h" #endif #ifdef USE_SOCKET_ROUTE #include #include #include #include -#include "route.h" +#include "./include/network_info_plus/route.h" #endif #ifdef USE_WIN32_CODE @@ -123,7 +123,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #endif -#include "getgateway.h" +#include "./include/network_info_plus/getgateway.h" #ifndef _WIN32 #define SUCCESS (0) diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/FPPCaptiveNetworkInfoProvider.h b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/FPPCaptiveNetworkInfoProvider.h similarity index 100% rename from packages/network_info_plus/network_info_plus/ios/Classes/FPPCaptiveNetworkInfoProvider.h rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/FPPCaptiveNetworkInfoProvider.h diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/FPPHotspotNetworkInfoProvider.h b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/FPPHotspotNetworkInfoProvider.h similarity index 100% rename from packages/network_info_plus/network_info_plus/ios/Classes/FPPHotspotNetworkInfoProvider.h rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/FPPHotspotNetworkInfoProvider.h diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfo.h b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/FPPNetworkInfo.h similarity index 100% rename from packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfo.h rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/FPPNetworkInfo.h diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfoPlusPlugin.h b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/FPPNetworkInfoPlusPlugin.h similarity index 100% rename from packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfoPlusPlugin.h rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/FPPNetworkInfoPlusPlugin.h diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfoProvider.h b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/FPPNetworkInfoProvider.h similarity index 100% rename from packages/network_info_plus/network_info_plus/ios/Classes/FPPNetworkInfoProvider.h rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/FPPNetworkInfoProvider.h diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/getgateway.h b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/getgateway.h similarity index 100% rename from packages/network_info_plus/network_info_plus/ios/Classes/getgateway.h rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/getgateway.h diff --git a/packages/network_info_plus/network_info_plus/ios/Classes/route.h b/packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/route.h similarity index 100% rename from packages/network_info_plus/network_info_plus/ios/Classes/route.h rename to packages/network_info_plus/network_info_plus/ios/network_info_plus/Sources/network_info_plus/include/network_info_plus/route.h From 895d2f19d8620b5d3b04ad7f2f416a4eb73f4139 Mon Sep 17 00:00:00 2001 From: charafau Date: Mon, 12 Aug 2024 16:32:14 +0900 Subject: [PATCH 2/5] include c files in podspec --- .../network_info_plus/ios/network_info_plus.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/network_info_plus/network_info_plus/ios/network_info_plus.podspec b/packages/network_info_plus/network_info_plus/ios/network_info_plus.podspec index b2d4e61954..352bf34877 100644 --- a/packages/network_info_plus/network_info_plus/ios/network_info_plus.podspec +++ b/packages/network_info_plus/network_info_plus/ios/network_info_plus.podspec @@ -14,7 +14,7 @@ Downloaded by pub (not CocoaPods). s.author = { 'Flutter Community Team' => 'authors@fluttercommunity.dev' } s.source = { :http => 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/network_info_plus' } s.documentation_url = 'https://pub.dev/packages/network_info_plus' - s.source_files = 'network_info_plus/Sources/network_info_plus/**/*.{h,m}' + s.source_files = 'network_info_plus/Sources/network_info_plus/**/*.{h,m,c}' s.public_header_files = 'network_info_plus/Sources/network_info_plus/include/**/*.h' s.dependency 'Flutter' s.platform = :ios, '12.0' From 0b3cf941f44ddb133ac26e419d3b68ccfebdffeb Mon Sep 17 00:00:00 2001 From: charafau Date: Mon, 12 Aug 2024 16:37:49 +0900 Subject: [PATCH 3/5] spm macos support for network info --- .../macos/network_info_plus.podspec | 5 ++-- .../contents.xcworkspacedata | 7 ++++++ .../macos/network_info_plus/Package.swift | 23 +++++++++++++++++++ .../NetworkInfoPlusPlugin.swift | 0 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 packages/network_info_plus/network_info_plus/macos/network_info_plus/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata create mode 100644 packages/network_info_plus/network_info_plus/macos/network_info_plus/Package.swift rename packages/network_info_plus/network_info_plus/macos/{Classes => network_info_plus/Sources/network_info_plus}/NetworkInfoPlusPlugin.swift (100%) diff --git a/packages/network_info_plus/network_info_plus/macos/network_info_plus.podspec b/packages/network_info_plus/network_info_plus/macos/network_info_plus.podspec index ecbb164a12..9d430be37a 100644 --- a/packages/network_info_plus/network_info_plus/macos/network_info_plus.podspec +++ b/packages/network_info_plus/network_info_plus/macos/network_info_plus.podspec @@ -13,11 +13,10 @@ Pod::Spec.new do |s| s.license = { :file => '../LICENSE' } s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' + s.source_files = 'network_info_plus/Sources/network_info_plus/**/*.swift' + s.public_header_files = 'network_info_plus/Sources/network_info_plus/**/*.h' s.dependency 'FlutterMacOS' s.platform = :osx s.osx.deployment_target = '10.14' end - diff --git a/packages/network_info_plus/network_info_plus/macos/network_info_plus/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/packages/network_info_plus/network_info_plus/macos/network_info_plus/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..919434a625 --- /dev/null +++ b/packages/network_info_plus/network_info_plus/macos/network_info_plus/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/network_info_plus/network_info_plus/macos/network_info_plus/Package.swift b/packages/network_info_plus/network_info_plus/macos/network_info_plus/Package.swift new file mode 100644 index 0000000000..6df71abf79 --- /dev/null +++ b/packages/network_info_plus/network_info_plus/macos/network_info_plus/Package.swift @@ -0,0 +1,23 @@ +// 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: "network_info_plus", + platforms: [ + .macOS("10.14") + ], + products: [ + .library(name: "network-info-plus", targets: ["network_info_plus"]) + ], + dependencies: [], + targets: [ + .target( + name: "network_info_plus", + dependencies: [], + resources: [ + ] + ) + ] +) diff --git a/packages/network_info_plus/network_info_plus/macos/Classes/NetworkInfoPlusPlugin.swift b/packages/network_info_plus/network_info_plus/macos/network_info_plus/Sources/network_info_plus/NetworkInfoPlusPlugin.swift similarity index 100% rename from packages/network_info_plus/network_info_plus/macos/Classes/NetworkInfoPlusPlugin.swift rename to packages/network_info_plus/network_info_plus/macos/network_info_plus/Sources/network_info_plus/NetworkInfoPlusPlugin.swift From f63ade6500ec5d8c705744caea538f931f63c4f1 Mon Sep 17 00:00:00 2001 From: charafau Date: Mon, 12 Aug 2024 16:45:54 +0900 Subject: [PATCH 4/5] remove swiftpm build directory --- .../xcode/package.xcworkspace/contents.xcworkspacedata | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 packages/network_info_plus/network_info_plus/macos/network_info_plus/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/packages/network_info_plus/network_info_plus/macos/network_info_plus/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/packages/network_info_plus/network_info_plus/macos/network_info_plus/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a625..0000000000 --- a/packages/network_info_plus/network_info_plus/macos/network_info_plus/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - From e96decbd9e93f96e1e5eaf8a7582f0acd479dd99 Mon Sep 17 00:00:00 2001 From: Volodymyr Date: Thu, 17 Oct 2024 13:17:57 +0300 Subject: [PATCH 5/5] fix(network_info_plus): Move privacy manifest for MacOS and declare it --- .../network_info_plus/macos/network_info_plus/Package.swift | 1 + .../Sources/network_info_plus}/PrivacyInfo.xcprivacy | 0 2 files changed, 1 insertion(+) rename packages/network_info_plus/network_info_plus/macos/{ => network_info_plus/Sources/network_info_plus}/PrivacyInfo.xcprivacy (100%) diff --git a/packages/network_info_plus/network_info_plus/macos/network_info_plus/Package.swift b/packages/network_info_plus/network_info_plus/macos/network_info_plus/Package.swift index 6df71abf79..95c8db297c 100644 --- a/packages/network_info_plus/network_info_plus/macos/network_info_plus/Package.swift +++ b/packages/network_info_plus/network_info_plus/macos/network_info_plus/Package.swift @@ -17,6 +17,7 @@ let package = Package( name: "network_info_plus", dependencies: [], resources: [ + .process("PrivacyInfo.xcprivacy"), ] ) ] diff --git a/packages/network_info_plus/network_info_plus/macos/PrivacyInfo.xcprivacy b/packages/network_info_plus/network_info_plus/macos/network_info_plus/Sources/network_info_plus/PrivacyInfo.xcprivacy similarity index 100% rename from packages/network_info_plus/network_info_plus/macos/PrivacyInfo.xcprivacy rename to packages/network_info_plus/network_info_plus/macos/network_info_plus/Sources/network_info_plus/PrivacyInfo.xcprivacy