Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(network_info_plus): Add Swift Package Manager support #3172

Merged
merged 6 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"),
]
)
]
)
Loading