Is it possible to use `kotlinc` programatically? I...
# announcements
r
Is it possible to use
kotlinc
programatically? I’d like to compile a kotlin class from a kotlin source file in a JVM app at runtime.
Obviously I can fork a real kotlinc external process, but I’d rather do it in the same JVM process if possible. If only for ease of deployment.
m
r
That’s awesome, thanks!
v
Besides that, you could also consider using the scripting support
r
The scripting might meet my needs… I basically want to have a data class compiled in my app that my app uses, but load a file that defines an instance of that data class at startup. So I need my app to be on the compile time classpath when the file is compiled. Scripting might do that for me.
Scripting works perfectly, thanks @Vampire.
👌 1