Use xcframework for Flutter iOS plugin. (#1547)

This commit is contained in:
Fangjun Kuang
2024-11-16 16:42:02 +08:00
committed by GitHub
parent e993c08538
commit 9a48012648
24 changed files with 216 additions and 49 deletions

View File

@@ -25,7 +25,7 @@ String? _path;
// https://github.com/flutter/codelabs/blob/main/ffigen_codelab/step_05/lib/ffigen_app.dart
// https://api.flutter.dev/flutter/dart-io/Platform-class.html
final DynamicLibrary _dylib = () {
if (Platform.isMacOS || Platform.isIOS) {
if (Platform.isMacOS) {
if (_path == null) {
return DynamicLibrary.open('libsherpa-onnx-c-api.dylib');
} else {
@@ -33,6 +33,14 @@ final DynamicLibrary _dylib = () {
}
}
if (Platform.isIOS) {
if (_path == null) {
return DynamicLibrary.open('sherpa_onnx.framework/sherpa_onnx');
} else {
return DynamicLibrary.open('$_path/sherpa_onnx.framework/sherpa_onnx');
}
}
if (Platform.isAndroid || Platform.isLinux) {
if (_path == null) {
return DynamicLibrary.open('libsherpa-onnx-c-api.so');

View File

@@ -17,7 +17,7 @@ topics:
- voice-activity-detection
# remember to change the version in ../sherpa_onnx_macos/macos/sherpa_onnx_macos.podspec
version: 1.10.30
version: 1.10.31
homepage: https://github.com/k2-fsa/sherpa-onnx
@@ -30,23 +30,23 @@ dependencies:
flutter:
sdk: flutter
sherpa_onnx_android: ^1.10.30
sherpa_onnx_android: ^1.10.31
# sherpa_onnx_android:
# path: ../sherpa_onnx_android
sherpa_onnx_macos: ^1.10.30
sherpa_onnx_macos: ^1.10.31
# sherpa_onnx_macos:
# path: ../sherpa_onnx_macos
sherpa_onnx_linux: ^1.10.30
sherpa_onnx_linux: ^1.10.31
# sherpa_onnx_linux:
# path: ../sherpa_onnx_linux
sherpa_onnx_windows: ^1.10.30
sherpa_onnx_windows: ^1.10.31
# sherpa_onnx_windows:
# path: ../sherpa_onnx_windows
sherpa_onnx_ios: ^1.10.30
sherpa_onnx_ios: ^1.10.31
# sherpa_onnx_ios:
# path: ../sherpa_onnx_ios