However, when trying to import com.intellij.compiler.server.BuildManagerListener on my Kotlin code, the com.intellij.compiler package is nowhere to be found. I’ve tried importing many other bundled plugins without success, and at this point I’m asking myself what I might be doing wrong, I thought having the CLion dependency would be enough, but that doesn’t seem to be the case.
Thanks for your answer, but I can’t seem to find any documentation about how that java_config.xml file works, or why… I’m also using Kotlin, not sure it matters?
I forgot to mention I’ve also tried to add a dependency with bundledPlugin("com.intellij.java") but that won’t work unless I make my plugin depend on IDEA I guess, but this is a CLion-only plugin and I don’t want to have a dependency on IDEA unless necessary…
Ah, I see what you mean now, but I think that will solve a runtime issue only. My problem is that I cannot even compile the plugin because those classes don’t seem to exist.
Even after adding that, IDEA just sets the “compiler.server.BuildManagerListener” part of the “topic” on that file red, because it cannot find it…
First of all, check your JDK configuration. Choose 17/21 versions as well as language version.
Install DevKit plugin. After update gradle dependencies: shift-shift, “Sync All” or in side menu. They must succeed. Delete “compiler” imports from your code and run / build the plugin.
After you setup working environment try to change dependencies and each time call “Sync All”
Sometimes it’s better to typo commands in console: ./gradle; ./gradle tasks; ./grandle runPlugin; etc
Thanks for your help. My plugin compiles and works fine with most Intellij APIs, is just the compiler one that seems missing for some reason, so my devkit plugin and other stuff is properly installed. I also have 21 set as the dependency, and I can’t see any other dependencies other than what I wrote above…
Taking a step back, do you know if BuildManagerListener is what I should still use to listen to build start/end events even for native builds on CLion? Maybe that’s a Java builds-only thing?
Indeed, that seems to be the wrong class altogether for CLion, I think you’re supposed to be using com.jetbrains.cidr.execution.build.CidrBuildListener instead, but of course, there is 0 documentation about this, unless there is some secret location I don’t know about.
Thanks anyway for your help @xepozz , appreciate it.