Hi, I am developing a plugin that builds the project for user in case a feature is invoked. For gradle/maven, I am using ProjectTaskManager to get a module build task, and then I run it like this
Now, my code is doing nothing in case there's a bazel project. So, I wanted to add a dependency on bazel for intelliJ plugin - https://plugins.jetbrains.com/plugin/8609-bazel-for-intellij on my plugin.
But this dependency is optional, as there's no need for it in case its a gradle/maven project.
So, in my build.gradle I have added this
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins.set(listOf("com.google.idea.bazel.ijwb:2023.05.02.0.1-api-version-223") + properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
And in my plugin.xml, I have added this -
<depends optional="true" config-file="">com.google.idea.bazel.ijwb</depends>
Since, I am not implementing any extension points, I wasn't sure what to put in the config-file, so I just put empty string, and it passed, but I am not really sure what it does.
And after building, I am able to import classes from the bazel plugin into my code.
Basically I am doing these 2 calls from my plugin in case its a bazel project
.incrementalProjectSync( /* reason= */"IncrementalSyncProjectAction")
After this when I run buildPlugin for my plugin, it passes. But when I execute the flow that is responsible for the calls above, it throws NoClassDefFoundError.
Any suggestions on how to achieve this functionality?