Skip to content

Commit

Permalink
feat(device_info_plus): Add Swift Package Manager support (#3167)
Browse files Browse the repository at this point in the history
Co-authored-by: Loïc Sharma <[email protected]>
Co-authored-by: Volodymyr <[email protected]>
  • Loading branch information
3 people authored Oct 16, 2024
1 parent cba3279 commit 6a347cb
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 6 deletions.
3 changes: 3 additions & 0 deletions packages/device_info_plus/device_info_plus/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ flutter_export_environment.sh

examples/all_plugins/pubspec.yaml

.build/
Podfile
Podfile.lock
Pods/
.swiftpm/
.symlinks/
**/Flutter/App.framework/
**/Flutter/ephemeral/
Expand Down Expand Up @@ -45,3 +47,4 @@ build/
.project
.classpath
.settings

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Downloaded by pub (not CocoaPods).
s.author = { 'Flutter Community Team' => '[email protected]' }
s.source = { :http => 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/device_info_plus' }
s.documentation_url = 'https://pub.dev/packages/device_info_plus'
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.source_files = 'device_info_plus/Sources/device_info_plus/**/*.{h,m}'
s.public_header_files = 'device_info_plus/Sources/device_info_plus/include/**/*.h'
s.dependency 'Flutter'
s.platform = :ios, '12.0'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.resource_bundles = {'device_info_plus_privacy' => ['PrivacyInfo.xcprivacy']}
s.resource_bundles = {'device_info_plus_privacy' => ['device_info_plus/Sources/device_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: "device_info_plus",
platforms: [
.iOS("12.0"),
],
products: [
.library(name: "device-info-plus", targets: ["device_info_plus"])
],
dependencies: [],
targets: [
.target(
name: "device_info_plus",
dependencies: [],
resources: [
.process("PrivacyInfo.xcprivacy"),
],
cSettings: [
.headerSearchPath("include/device_info_plus")
]
)
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "FPPDeviceInfoPlusPlugin.h"
#import "./include/device_info_plus/FPPDeviceInfoPlusPlugin.h"
#import <sys/utsname.h>

@implementation FPPDeviceInfoPlusPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ https://github.com/flutter/flutter/issues/46618
s.license = { :file => '../LICENSE' }
s.author = { 'Flutter Community' => '[email protected]' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.source_files = 'device_info_plus/Sources/device_info_plus/**/*.swift'
s.public_header_files = 'device_info_plus/Sources/device_info_plus/**/*.h'
s.dependency 'FlutterMacOS'

s.platform = :osx
Expand Down
Original file line number Diff line number Diff line change
@@ -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: "device_info_plus",
platforms: [
.macOS("10.14")
],
products: [
.library(name: "device-info-plus", targets: ["device_info_plus"])
],
dependencies: [],
targets: [
.target(
name: "device_info_plus",
dependencies: [],
resources: [
]
)
]
)

0 comments on commit 6a347cb

Please sign in to comment.