Adding "plugin on disk" as a dependency for another plugin

I have a plugin named "my-plugin".

I have another plugin named "sample-plugin". I need to add "my-plugin" as a dependency to "sample-plugin". I went through the page https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html. There is no mention of how to add a local plugin as a dependency, in the gradle section.

I am using Gradle and I want to add "my-plugin" as a dependency to "sample-plugin". How do I do this?

3 comments
Comment actions Permalink

So this is what I ended up doing to get my dependency set right.

1. I added "my-plugin" as a dependency in build.gradle

intellij {
version '2018.2'
plugins 'my-plugin'
}

2. I got an error saying "my-plugin" is missing in /Users/XXXXXXXXXXX/.gradle/caches/modules-2/files2.1/com.jetbrains.intellij.idea/ideaIC/2018.2/76asd87f6as78d6fa8sdf7s678a6sdf7s6adf78/ideaIC-2018.2/

3. So I added "my-plugin" to the location above /Users/XXXXXXXXXXX/.gradle/caches/modules-2/files2.1/com.jetbrains.intellij.idea/ideaIC/2018.2/76asd87f6as78d6fa8sdf7s678a6sdf7s6adf78/ideaIC-2018.2/plugins

4. Now 'my-plugin' is considered as a bundled plugin and my dependency works.

I know this is not the right solution, but this is what I have got now. Please help me out on what the right way is.

0
Comment actions Permalink

Hi Henry,

Here is the comprehensive documentation that covers your question: https://github.com/JetBrains/gradle-intellij-plugin/blob/master/README.md

```

plugins - The list of bundled IDEA plugins and plugins from the IDEA repository

Notes:

  • For plugins from the IDEA repository use format pluginId:version.
  • For bundled plugins use directory name of the plugin in IDEA distribution (e.g. Groovy for IDEA/plugins/Groovy).
  • For sub-projects use project reference project(':subproject').

```

>  So I added "my-plugin" to the location above

This is what makes your build non-reproducible on any other machine on any other IDEA version.

1
Comment actions Permalink

Thank you very much. I published my dependency plugin "Handlebars Support" to the repository. So things are going to be easy now :)
But I am glad we have a way to accomplish this, will keep in mind for my future projects.

0

Please sign in to leave a comment.