Is it possible to import classes from kotlinx package in a simple Kotlin script?
myscript.kts:
import kotlinx.serialization.*
import kotlinx.serialization.json.*
println("")
Running the above script with kotlinc -script myscript.kts gives this error:
error: unresolved reference: kotlinx
When I checked kotlinc/lib/ directory, there exists kotlinx-coroutines-core.jar and so on.
I am using Kotlin compiler version 1.4.0.
@file:DependsOn()and@file:Repository()to add dependency and repos, but I have no idea to use serialization as it is mainly a compiler plugin, and generates stubs on build, I guess that is not really possible. - Animesh Sahu