Maciej Miklas February 2016

How to customize IntelliJ 15 Gradle integration?

This is actually quiet normal that people are customising Gradle tasks. For example there are tones of examples how you can customise project generated by Gradle integration in Eclipse. So that you can enable custom code formatter, validation rules, find bugs plugin, generate hibernate classes ... and so on.

I'm trying to figure out how Gradle integration is realised in IntelliJ. For some reason they are not using Gradle plugin but Gradle tooling API.

Is is possible to customise Gradle integration? If yes - is there documentation or examples ? if no - what is the reason for such decision?

Answers


tobiasH February 2016

There is an Idea Plugin for Gradle. It used to be used through a task that generated an .ipr file for IntelliJ. Since Idea 13 its used by Idea through the tooling API. It's rather limited and some features don't seem to work anymore through the tooling API, but I use it for excluding source sets and configuring Idea's build output directory. For advanced things, the only option seems to be to edit the generated .ipr file, the Gradle Idea plugin provides a hook for that.

Alternatively there are numerous plugins for IntelliJ for sharing or importing code styles independently from Gradle.

Post Status

Asked in February 2016
Viewed 3,722 times
Voted 12
Answered 1 times

Search




Leave an answer