intellij plugin development and build.gradle and plugin.xml

Answered

i'm learning intellij plugin development but i can't grasp the REAL different between build.gradle and plugin.xml files for intellij plugin development..

like what are the differences between their dependecies and plugin properities, and relationships between them, and what do i need to learn specifically in gradle to develop intellij plugins, because from plugins i saw, they all have almost the same build.gradle components and fields.

what i need to know:

  • the difference between build.gradle dependencies and plugin.xml similarly named properities (dependecies,plugins).
  • what dependencies should be wrote in plugin.xml and build.gradle?
  • what do i need to study in gradle to start developing intellij plugins ? (It is a HUGE tool).
  • any step by step sources for newbies in intellij plugin development? the intellij plugin docs are competelely useless for newbies because of the enormous dipersion in information..

Thanks! :D

1
1 comment

Hi,

The answers are below.

  • the difference between build.gradle dependencies and plugin.xml similarly named properities (dependecies,plugins).

The dependencies in the plugin.xml are dependencies to other IntelliJ plugin modules. A module can provide some specific functionality, e.g. com.intellij.modules.java contains Java language functionality if you need to access Java program structure in your plugin (so basically use PSI or other API classes operating on Java code), then you have to add this dependency. See also:

- https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html#3-dependency-declaration-in-pluginxml
- https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html#declaring-plugin-dependencies and other sections under "Part VIII - Product Specific"

The dependencies in the Gradle build file are just dependencies of your plugin project, so basically libraries you need to implement your plugin (e.g. some utils, etc).
The plugins in the Gradle build file is a list of plugins that will be automatically installed when you run the development instance of the IDE, so not the IDE you are developing your plugin in, but the one you use to run/test your plugin (see runIde task: https://github.com/JetBrains/gradle-intellij-plugin#tasks).

 

  • what dependencies should be wrote in plugin.xml and build.gradle?

It depends on your needs and you have to understand the above to answer this question to yourself.

 

  • what do i need to study in gradle to start developing intellij plugins ? (It is a HUGE tool).

I would say basics are enough, so understand what a Gradle task is, how to configure them, what are Gradle settings, how to run tasks, etc. After that get familiar with Gradle IntelliJ Plugin tasks and configuration: https://github.com/JetBrains/gradle-intellij-plugin.

 

  • any step by step sources for newbies in intellij plugin development? the intellij plugin docs are competelely useless for newbies because of the enormous dipersion in information..

We are trying to make them easier, but it is a hard task due to the enormous size of the platform. It is a fact that developing IntelliJ plugin requires some higher effort and time to understand the concepts. You will not avoid digging in the platform code and debugging it to understand how something works.

I recommend taking a look at https://jb.gg/ipe for checking how other open-source plugins implement a given extension/functionality.

1

Please sign in to leave a comment.