Is there a way to user kotlinx serialization in a foo.main.kts?
p
Is there a way to user kotlinx serialization in a foo.main.kts?
m
THeoretically but not the compiler plugin so @Serializable won't work
p
What's the closest solution I could use?
m
You can implement all serializers by yourself or use something like jackson
p
Ok. Is there an issue/KEEP about this I missed on my way?
m
not to my knowledge
Also don't think this will change, as only gradle is supported
p
Thanks for the input
d
Fwiw, there's a ticket for doing this outside gradle.
p
Do you have the url at hand?
d
b
If using a shebang is an option (and running with
./foo.main.kts
in a terminal), this has worked nicely for me:
#!/usr/bin/env -S kotlinc -jvm-target 1.8 -script -Xplugin="${KOTLIN_HOME}/lib/kotlinx-serialization-compiler-plugin.jar" --