Are you a library developer publishing static reso...
# opensource
c
Are you a library developer publishing static resources alongside your Kotlin code? You may have noticed that JVM users can access your library's resources, but other platforms can't. My Gradle plugin KotlinJS Resources now works for all platforms, even Native, and supports Kotlin 2.1.X and 2.2.X. https://gitlab.com/opensavvy/automation/kotlin-js-resources
🔥 1
m
Is there an example of how to read the resources on native? Found this but this seems to be only JS?
I've been following up https://youtrack.jetbrains.com/issue/KT-39194/Embedding-resources-to-Native-binaries eagerly. Is
kotlin-js-resources
a possible solution?
c
What my plugin does is put the resources from the libraries in the
src/xxxMain/resources
of the downstream project. Once it's there, you can use whatever you would have used if you just copy-pasted the resources from the library into your own resources, I don't provide anything more, so if Native can't access the module's resources, I can't help at the moment 😕
👍 1
All of this started because KGP does put the static resources in the
.klib
, it just doesn't let you consume them afterwards
👍 1
m
I see. I'll probably keep using string literals for now 😄