Skip to content

Commit

Permalink
chore: use ffi and pods dependencies for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
luiscib3r committed May 14, 2023
1 parent 9930d47 commit 909fcd8
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 79 deletions.
37 changes: 0 additions & 37 deletions ios/.gitignore

This file was deleted.

Empty file removed ios/Assets/.gitkeep
Empty file.
14 changes: 0 additions & 14 deletions ios/Classes/SwiftTfliteFlutter.swift

This file was deleted.

4 changes: 0 additions & 4 deletions ios/Classes/TfliteFlutterPlugin.h

This file was deleted.

15 changes: 0 additions & 15 deletions ios/Classes/TfliteFlutterPlugin.m

This file was deleted.

27 changes: 19 additions & 8 deletions ios/tflite_flutter.podspec
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint tflite_flutter_plugin.podspec' to validate before publishing.
# Run `pod lib lint tflite_flutter.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'tflite_flutter'
s.version = '0.1.0'
s.version = '0.0.1'
s.summary = 'TensorFlow Lite plugin for Flutter apps.'
s.description = <<-DESC
TensorFlow Lite plugin for Flutter apps.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }

# This will ensure the source files in Classes/ are included in the native
# builds of apps using this FFI plugin. Podspec does not support relative
# paths, so Classes contains a forwarder C file that relatively imports
# `../src/*` so that the C sources can be shared among all target platforms.
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
# s.source_files = 'Classes/**/*'

s.dependency 'Flutter'
s.platform = :ios, '8.0'

s.ios.deployment_target = '9.0'
s.dependency 'TensorFlowLiteSwift'
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
tflite_version = '2.12.0'
s.dependency 'TensorFlowLiteC', tflite_version
s.dependency 'TensorFlowLiteC/Metal', tflite_version
s.dependency 'TensorFlowLiteC/CoreML', tflite_version

s.platform = :ios, '11.0'
s.static_framework = true

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
s.swift_version = '5.0'
end
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ flutter:
package: com.tfliteflutter.tflite_flutter_plugin
pluginClass: TfliteFlutterPlugin
ios:
pluginClass: TfliteFlutterPlugin
ffiPlugin: true
linux:
pluginClass: TfliteFlutterPlugin

Expand Down

0 comments on commit 909fcd8

Please sign in to comment.