Calling kotlinc with plugins from the command line

I am trying to understand how kotlin compiler plugins are invoked using the command line (not with gradle or maven). I have a few questions using the allopen plugin as an example…

Consider the following invocation of the kotlin compiler:

-cp kotlin-preloader.jar
-cp kotlin-compiler.jar
-d myjar.jar
-cp allopen-compiler-plugin.jar:mylib.jar

  1. Where should the allopen-compiler-plugin jar go? In the last classpath (for kotlin file deps), the classpath to the preloader, or the classpath to java itself?

  2. What is the significance of the plugin name “allopen” (in plugin:allopen:key=value) ? Is this used to match against some token that’s hardcoded into the plugin implementation?

Thanks in advance,


1 Like