Open
Description
Status Quo:
Flutter SDK is needed even if we are using dart
command only - due to the way package:jni
is packaged.
In theory it is possible to comment out flutter-specific parts and use the same module from standalone and flutter targets. But due to problems with pub
, we are not able to do it. pub#3563.
There are 2 parts where we need the flutter features.
- The initialization plugin:
JniPlugin.Java
, android only. - FFI asset bundling:
ffiPlugin: true
directive, all flutter targets.
Proposed Design:
There should be 2 packages, package:jni
and package:flutter_jni_interface
The latter doesn't need to be touched by user code, apart from being included in pubspec. Latter being a flutter-specific plugin, it handles initializing android JNI behind the scenes, or packaging the DLL.
Open questions:
- This doesn't probably solve the FFI plugin packaging problem. - Because as I am aware,
ffiPlugin
expects native code atsrc/
.- Can
flutter_jni_interface
be nested inpackage:jni
? This will change latter's native source path toflutter_jni_interface/src
. But only our setup scripts need to be changed to accommodate this.
- Can
Disadvantages:
- Flutter users will have to add 2 packages instead of 1.
cc: @dcharkes
Metadata
Metadata
Assignees
Type
Projects
Status
Backlog