Is it possible to enable compiler plugins for kts compilation. I would like to compile Compose code inside of an Kotlin application. Ideally i would like to have the code as kotlin script and than execute the script during runtime from the host program.
m
mbonnin
04/03/2021, 1:20 PM
It is possible. You can pass them on the command line. It's not the easiest thing but I tried it, I think with the serialization plugin, and it worked.
Yes it is possible to use plugins but i think Compose still uses a modified kotlin compiler or s.th. like that because i get following error when i execute kotlinc in cmd line:
exception: java.lang.IllegalStateException: The provided plugin androidx.compose.compiler.plugins.kotlin.ComposeComponentRegistrar is not compatible with this version of compiler