Is there a Kotlin equivalent of javax.tools.JavaCompiler?

I’m writing a code generator and it might evolve in the direction of hot-swapping code in the JVM. Writing it in Java would let me do that by invoking the compiler programattically. Is there a way to do that with kotlinc that doesn’t involve creating temporary files and/or shelling out?

3 Likes

You can try tschuchortdev/kotlin-compile-testing on Github

1 Like

Scripting does that: KEEP/scripting-support.md at master · Kotlin/KEEP · GitHub

1 Like