Skip to content

Commit

Permalink
feat(network_info_plus): Add Swift Package Manager support (#3172)
Browse files Browse the repository at this point in the history
Co-authored-by: Volodymyr Buberenko <vbuberen@users.noreply.github.com>
Co-authored-by: Volodymyr <v.buberenko@gmail.com>
  • Loading branch information
3 people authored Oct 17, 2024
1 parent a14d472 commit bcf7a5b
Show file tree
Hide file tree
Showing 20 changed files with 68 additions and 18 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -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,c}'
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
Original file line number Diff line number Diff line change
@@ -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")
]
)
]
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "FPPCaptiveNetworkInfoProvider.h"
#import "./include/network_info_plus/FPPCaptiveNetworkInfoProvider.h"
#import <SystemConfiguration/CaptiveNetwork.h>

@implementation FPPCaptiveNetworkInfoProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "FPPHotspotNetworkInfoProvider.h"
#import "./include/network_info_plus/FPPHotspotNetworkInfoProvider.h"
#import <NetworkExtension/NetworkExtension.h>

@implementation FPPHotspotNetworkInfoProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "FPPNetworkInfo.h"
#import "./include/network_info_plus/FPPNetworkInfo.h"

@implementation FPPNetworkInfo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <CoreLocation/CoreLocation.h>

#include <ifaddrs.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ POSSIBILITY OF SUCH DAMAGE.
#include <sys/sysctl.h>
#include <sys/socket.h>
#include <net/if.h>
#include "route.h"
#include "./include/network_info_plus/route.h"
#endif
#ifdef USE_SOCKET_ROUTE
#include <unistd.h>
#include <string.h>
#include <sys/socket.h>
#include <net/if.h>
#include "route.h"
#include "./include/network_info_plus/route.h"
#endif

#ifdef USE_WIN32_CODE
Expand All @@ -123,7 +123,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <iphlpapi.h>
#endif

#include "getgateway.h"
#include "./include/network_info_plus/getgateway.h"

#ifndef _WIN32
#define SUCCESS (0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ 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'
s.resource_bundles = {'network_info_plus_privacy' => ['PrivacyInfo.xcprivacy']}
end

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// 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: [
.process("PrivacyInfo.xcprivacy"),
]
)
]
)

0 comments on commit bcf7a5b

Please sign in to comment.