https://kotlinlang.org logo
Title
a

Adam S

04/22/2023, 11:43 AM
I want to convert a Kotlin/JVM library to Multiplatform. The biggest amount of work is an Apache library, which of course is JVM only. I think the first step is to split the code into commonMain/jvmMain, and use expect/actuals to decouple from the JVM lib, and then I could look at expanding to other targets. That first step is a lot of repetitive work though. It’d be nice if there was a tool that would generate expect/actual functions for a Java lib - it would make the process easier and less error prone. There are tools for generating interop code for C and JavaScript libraries. Is there one that generates interop code for Java libraries?
c

CLOVIS

04/24/2023, 4:21 PM
You don't really want to have all functions be part of your API, right? Or maybe not exactly the same. I don't think it's possible to this automatically