Can we build platform specific libraries into kexe...
# multiplatform
v
Can we build platform specific libraries into kexe binary? Which can be shared with the JVM UI project? I need to change the wallpaper and screen saver. This needs access to the windows registry and on macos system configuration framework. On Linux CMD execution. To send files need access to WiFi and Bluetooth. So let's say I have a share interface. Each platform has its implementation. Now I want to generate a binary for each platform and add as dependency to JVM UI ie Compose Multiplatform.
j
Any chance to share more concrete info? What library exactly?
v
Update details above
j
Sounds like the normal use case for expect/actual (https://kotlinlang.org/docs/multiplatform-expect-actual.html) to me... Or did you mean something more specific there?
v
ya, but source set cannot be accessed in JVM target. The UI is in the dasktopMain while the shared module have source in mingwX64Main, macosMain.
j
I'm sorry, I still don't understand the question 😞 The native platforms don't use JVM (because they are native), so not sure what you are trying to achieve...
v
The UI layer is in compose. Which run on top of Jvm. To access platform only way to access is via using JNI or System.load static library. Or be dependent on java library projects. I was wondering if i can create a kotlin native library binary and add it as dependencies in dasktopMain target.
j
If you are on a platform where it is run in a JVM (but I doubt Compose on eg. iOS runs in a JVM), you in the end need to use JNI to access native library, there does not seem to be a way to use the library directly; at least according to https://stackoverflow.com/questions/75485391/is-it-possible-to-use-a-kotlin-native-project-as-library-in-a-kotlin-jvm-project and https://youtrack.jetbrains.com/issue/KT-39144
👍 1