Skip to content

Commit

Permalink
[local_auth] Endorse macOS (#7274)
Browse files Browse the repository at this point in the history
Updates the app-facing package to endorse `local_auth_darwin` as the macOS implementation, and require a version of that package with macOS support. Updates the README to indicate that macOS is supported. Adds macOS support to the example app (using `flutter create --platforms=macos .` in the example).

Fixes flutter/flutter#140685
  • Loading branch information
stuartmorgan authored Aug 6, 2024
1 parent 551bde5 commit db8bfed
Show file tree
Hide file tree
Showing 30 changed files with 1,362 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/local_auth/local_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.3.0

* Adds endorsed macOS support.

## 2.2.0

* Switches endorsed iOS implementation to `local_auth_darwin`.
Expand Down
6 changes: 3 additions & 3 deletions packages/local_auth/local_auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ the user.
On supported devices, this includes authentication with biometrics such as
fingerprint or facial recognition.

| | Android | iOS | Windows |
|-------------|-----------|-------|-------------|
| **Support** | SDK 16+\* | 12.0+ | Windows 10+ |
| | Android | iOS | macOS | Windows |
|-------------|-----------|-------|--------|-------------|
| **Support** | SDK 16+\* | 12.0+ | 10.14+ | Windows 10+ |

## Usage

Expand Down
7 changes: 7 additions & 0 deletions packages/local_auth/local_auth/example/macos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Flutter-related
**/Flutter/ephemeral/
**/Pods/

# Xcode-related
**/dgph
**/xcuserdata/
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
40 changes: 40 additions & 0 deletions packages/local_auth/local_auth/example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
Loading

0 comments on commit db8bfed

Please sign in to comment.