4

Is it possible to use a Kotlin-Native project as library in a Kotlin-JVM project? Basically what I want is to use Kotlin-Native instead of something like JNI or JNA.

So the project would look like this:

project
- application
  - runs on JVM
  - depends on native-lib and core, and other Java/Kotlin JVM libraries
- native-lib
  - contains platform-specific implementation
  - depends on core
- core
  - has no dependencies except maybe kotlin stdlib
  - contains common types so application and native-lib can share data

All I've found is this three year old thread, which says it's not possible yet, but will be. The official documentation doesn't mention this option at all.

So, is there any update? I'd appreciate a link to the relevant documentation and/or examples.

And if this is not possible, how do I create JNI bindings so my JVM Kotlin code can use the Kotlin/Native code?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.