is there a way to package resources like a json fi...
# kotlin-native
r
is there a way to package resources like a json file inside a .kexe or .exe
👀 2
d
Yes but it's non trivial.
Have a look at immutable byte array.
b
I'd also be curious to see some examples of it (however rough) as I had attempted this before with little success and in the end had to resort to packaging my resources along the executable and reading them from the fs
b
(last time I tried I employed a dirty trick: I generated a byte array in a Kotlin file in the project - not great obviously)
d
That's exactly the way to do it right now. A gradle plugin would be nice.
b
Ah, i see. So you basically "encode" your assed into the actual
*,kt
source file (i.e. you don't actually embed any resources, because at that point it's just a source file to be compiled)
g
There’s also an open issue for this: https://youtrack.jetbrains.com/issue/KT-39194
👍 3
3