Skip to content

Commit 4d4567a

Browse files
authored
[local_auth_darwin] Adds Swift Package Manager compatibility (flutter#6708)
Adds Swift Package Manager support to `local_auth_darwin`. This does not migrate the example app's Xcode project to use Swift Package Manager, that's tracked by flutter#148021. Fixes flutter#146911
1 parent 69a35b2 commit 4d4567a

File tree

12 files changed

+50
-10
lines changed

12 files changed

+50
-10
lines changed

packages/local_auth/local_auth_darwin/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.3.0
2+
3+
* Adds Swift Package Manager compatibility.
4+
15
## 1.2.2
26

37
* Adds compatibility with `intl` 0.19.0.

packages/local_auth/local_auth_darwin/darwin/Assets/.gitkeep

Whitespace-only changes.

packages/local_auth/local_auth_darwin/darwin/local_auth_darwin.podspec

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ Downloaded by pub (not CocoaPods).
1414
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
1515
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/local_auth' }
1616
s.documentation_url = 'https://pub.dev/packages/local_auth_darwin'
17-
s.source_files = 'Classes/**/*'
18-
s.public_header_files = 'Classes/**/*.h'
17+
s.source_files = 'local_auth_darwin/Sources/local_auth_darwin/**/*.{h,m}'
18+
s.public_header_files = 'local_auth_darwin/Sources/local_auth_darwin/include/**/*.h'
1919
s.dependency 'Flutter'
2020
s.platform = :ios, '12.0'
2121
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
22-
s.resource_bundles = {'local_auth_darwin_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
22+
s.resource_bundles = {'local_auth_darwin_privacy' => ['local_auth_darwin/Sources/local_auth_darwin/Resources/PrivacyInfo.xcprivacy']}
2323
end
24-
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
// Copyright 2013 The Flutter Authors. All rights reserved.
5+
// Use of this source code is governed by a BSD-style license that can be
6+
// found in the LICENSE file.
7+
8+
import PackageDescription
9+
10+
let package = Package(
11+
name: "local_auth_darwin",
12+
platforms: [
13+
.iOS("12.0"),
14+
.macOS("10.14"),
15+
],
16+
products: [
17+
.library(name: "local-auth-darwin", targets: ["local_auth_darwin"])
18+
],
19+
dependencies: [],
20+
targets: [
21+
.target(
22+
name: "local_auth_darwin",
23+
dependencies: [],
24+
resources: [
25+
.process("Resources")
26+
],
27+
cSettings: [
28+
.headerSearchPath("include/local_auth_darwin")
29+
]
30+
)
31+
]
32+
)

packages/local_auth/local_auth_darwin/darwin/Classes/FLALocalAuthPlugin.m renamed to packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/FLALocalAuthPlugin.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
#import "FLALocalAuthPlugin.h"
5-
#import "FLALocalAuthPlugin_Test.h"
4+
#import "./include/local_auth_darwin/FLALocalAuthPlugin.h"
5+
#import "./include/local_auth_darwin/FLALocalAuthPlugin_Test.h"
66

77
#import <LocalAuthentication/LocalAuthentication.h>
88

packages/local_auth/local_auth_darwin/darwin/Classes/messages.g.m renamed to packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/messages.g.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
// Autogenerated from Pigeon (v13.1.2), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

7-
#import "messages.g.h"
7+
// The line below is manually edited. See:
8+
// https://github.com/flutter/flutter/issues/147587
9+
#import "./include/local_auth_darwin/messages.g.h"
810

911
#if TARGET_OS_OSX
1012
#import <FlutterMacOS/FlutterMacOS.h>

0 commit comments

Comments
 (0)