Posted on

Gson

vi k.kts
@file:CompilerOpts("-jvm-target 1.8")
@file:DependsOn("com.google.code.gson:gson:2.8.5")
@file:KotlinOpts("-J-Xmx1024M")

val gson = com.google.gson.Gson()
println(gson.toJson(listOf(1, 2, 3)))
class JO() {
    val a = 1
    val b = 2
    val c = 3
    val d = "d"
    val choices = listOf(1, 2, 3, "d")
}
val jo = JO()
val jo_string = gson.toJson(jo)
println(jo_string)
ks k.kts

uses kotlinc and kscript