Skip to content

Commit

Permalink
[local_auth_darwin] Adds Swift Package Manager compatibility (#6708)
Browse files Browse the repository at this point in the history
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/flutter#148021.

Fixes flutter/flutter#146911
  • Loading branch information
loic-sharma committed May 10, 2024
1 parent 69a35b2 commit 4d4567a
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/local_auth/local_auth_darwin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.0

* Adds Swift Package Manager compatibility.

## 1.2.2

* Adds compatibility with `intl` 0.19.0.
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ Downloaded by pub (not CocoaPods).
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/local_auth' }
s.documentation_url = 'https://pub.dev/packages/local_auth_darwin'
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.source_files = 'local_auth_darwin/Sources/local_auth_darwin/**/*.{h,m}'
s.public_header_files = 'local_auth_darwin/Sources/local_auth_darwin/include/**/*.h'
s.dependency 'Flutter'
s.platform = :ios, '12.0'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.resource_bundles = {'local_auth_darwin_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
s.resource_bundles = {'local_auth_darwin_privacy' => ['local_auth_darwin/Sources/local_auth_darwin/Resources/PrivacyInfo.xcprivacy']}
end

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import PackageDescription

let package = Package(
name: "local_auth_darwin",
platforms: [
.iOS("12.0"),
.macOS("10.14"),
],
products: [
.library(name: "local-auth-darwin", targets: ["local_auth_darwin"])
],
dependencies: [],
targets: [
.target(
name: "local_auth_darwin",
dependencies: [],
resources: [
.process("Resources")
],
cSettings: [
.headerSearchPath("include/local_auth_darwin")
]
)
]
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "FLALocalAuthPlugin.h"
#import "FLALocalAuthPlugin_Test.h"
#import "./include/local_auth_darwin/FLALocalAuthPlugin.h"
#import "./include/local_auth_darwin/FLALocalAuthPlugin_Test.h"

#import <LocalAuthentication/LocalAuthentication.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
// Autogenerated from Pigeon (v13.1.2), do not edit directly.
// See also: https://pub.dev/packages/pigeon

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

#if TARGET_OS_OSX
#import <FlutterMacOS/FlutterMacOS.h>
Expand Down
7 changes: 5 additions & 2 deletions packages/local_auth/local_auth_darwin/pigeons/messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import 'package:pigeon/pigeon.dart';

@ConfigurePigeon(PigeonOptions(
dartOut: 'lib/src/messages.g.dart',
objcHeaderOut: 'darwin/Classes/messages.g.h',
objcSourceOut: 'darwin/Classes/messages.g.m',
objcHeaderOut:
'darwin/local_auth_darwin/Sources/local_auth_darwin/include/local_auth_darwin/messages.g.h',
objcSourceOut:
'darwin/local_auth_darwin/Sources/local_auth_darwin/messages.g.m',
objcOptions: ObjcOptions(
headerIncludePath: './include/local_auth_darwin/messages.g.h',
prefix: 'FLAD', // Avoid runtime collisions with old local_auth_ios classes.
),
copyrightHeader: 'pigeons/copyright.txt',
Expand Down
2 changes: 1 addition & 1 deletion packages/local_auth/local_auth_darwin/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: local_auth_darwin
description: iOS implementation of the local_auth plugin.
repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth_darwin
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22
version: 1.2.2
version: 1.3.0

environment:
sdk: ^3.2.3
Expand Down

0 comments on commit 4d4567a

Please sign in to comment.