Is there kind of thing allow me to compile Kotlin program in memory, like ECJ (the Eclipse java compiler)?
1 Answer
Yes. I believe K2JVMCompiler will satisfy your needs.
I don't believe you will find much documentation for it though. The best place to start would probably be in Kotlin's own smoke tests which use the class.
3 Comments
Jayson Minard
You can find a sample of using the Kotlin compiler within the Kobalt build system. See this file here: github.com/cbeust/kobalt/blob/master/src/main/kotlin/com/beust/…
Cedric Beust
Also, note that
K2MVCompiler does not support incremental compilation just yet, this is only supported in IDEA (and soon Gradle I hear).mfulton26
@CedricBeust thanks; I've edited my answer accordingly