Manipulate the gradle project via idea in the Intellij plugin
Answered
Hi, I'm new to Kotlin and plugin development!
I'd like to be able to use plugins to manipulate the gradle project through idea, for example, get dependencies on the gradle project, run a gradle task in the "run" window of idea, etc
Please sign in to leave a comment.
Hi,
Unfortunately, there is no Gradle plugin API available in the SDK documentation.
I suggest getting familiar with the Exploring API techniques: https://plugins.jetbrains.com/docs/intellij/explore-api.html and inspecting classes from the Gradle plugin.
Regarding running a Gradle task in the IDE interface, please check how Gradle's Run Anything feature is implemented. See:
org.jetbrains.plugins.gradle.execution.GradleRunAnythingProvider
Sorry for the late of the reply (because I was at school a while ago)
I understand which extension points should be used, but how do I add dependencies? I'm referring to the dependencies of the gradle intellij plugin, e.g. I need to extend what you said `org.jetbrains.plugins.gradle.execution.GradleRunAnythingProvider`, but I can't find this class
I've gotten usage by looking at other open source projects, still very much appreciated
Hi,
Please see https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
Regarding GradleRunAnythingProvider, I didn't mean extending it, but getting inspired by its implementation about how to run Gradle tasks programmatically.