Output folder of the Kotlin compiler in Eclipse

后端 未结 2 2191
攒了一身酷
攒了一身酷 2021-02-15 00:56

The Jetbrains Kotlin compiler in Eclipse outputs to a hidden folder inside the Eclipse compiler plugin. This hidden folder is then made available through the Eclipse Kotlin clas

2条回答
  •  情歌与酒
    2021-02-15 01:20

    From the short analysis of the code of Kotlin plugin, it looks like the proper method is KotlinCompiler.compileKotlinFiles. It is being called in two contexts:

    1. KotlinBuilder.build — this is the one called on the project build; it makes a call stack trick (or rather a hack...) to check if being called from the LaunchConfigurationDelegate, and depending on the results, either compiles whole project (via its own private fun compileKotlinFiles), or just makes stubs in memory.
    2. KotlinCompilerUtils.compileWholeProject — this is in fact being called from 1.; nice static method, perfect for abuse until the problem is correctly solved in the plugin. :)

    So, I'd use the method from 2. wrapped in a similar way as compileKotlinFiles from file in 1.

提交回复
热议问题