I just released the first production version of KM...
# feed
a
I just released the first production version of KMbed, my new Kotlin/Native resource plugin. It allows embedding resources into the produced binary and automatically handles compression too. It also comes with kotlinx.io integration out of the box. Its API is strongly inspired by Android's R-class, but a little more dynamic. https://git.karmakrafts.dev/kk/kmbed
K 14
p
I'm wondering if it would be easy to generalize to other targets? A bit confusing to read: > KMbed is a Gradle/*KMP* plugin for embedding resources in Kotlin/*Native* executables. I've recently worked on something similar, easily adaptable to all Kotlin targets: ConvertCommonTestResourcesToKotlin. Apart from accessing the resource by its path, the consumer part also implements Okio's
FileSystem
. For now it sits as a piece of build logic in snakeyaml-engine-kmp, but it indeed looks like a generic enough problem to extract it to a library. Perhaps we could join forces!
👀 1
🙌 1
a
That sounds really good! If you'd like to join forces, that would be cool ^^ And yes, KMP and Native reads a bit odd, but it's what it is; it uses KMP but only supports Kotlin/Native as of right now.
👍 1
p
I think the first step is to enable as many targets in your lib, most prominently JVM and JS
👍 1
a
I should be able to do this after work without too much trouble i think. The codegen should work everywhere, the runtime can be adjusted for JS/JVM. On the JVM i can use InflaterInputStream for decompression since that directly implements zlib too. On the web, i can just include a WASM version of zlib. That should solve most of the issues.
s
@Alexander Hinze This is nice and really one of the pain points for working with Kotlin Native (Java resources will work out of the box on GraalVM native image and Go has embed tag) . Are there any plans to publish this to Maven Central?
a
First of all, thank you very much! 🙂 I've wanted to publish my libs to MC for a while now, but sadly the person that owns one of my two domains never responded to my requests for buying it. So i can't publish under my short-domain right now, which is all my Kotlin packages :/