Gradle + Eclipse/IntelliJ integration for watching (re)sources and executing different tasks on file changes (automatic continuous builds inside IDEs)

Hi,

First of all, I’m a newbie in Gradle, but I’m wondering if there is a standard integration mechanism in different IDEs similar to the continuous builds in command-line.

The goal would be to write custom Gradle tasks/plugins and have them execute if certain source files or resource files change in the imported projects. Like generating Java model classes from XSD files and regenerating the classes when you modify an XSD file. According to this answer from last year, this integration is not supported in Buildship.

I know there is something in case of Maven+Eclipse M2E integration, but I guess that depends on Eclipse and in IntelliJ it doesn’t work.

But as I read so far, Gradle tries to solve these incompatibility issues by delegating every work from the IDE to Gradle itself. That’s why I’m asking if there is an existing or planned solution for this that would work in the same way from the command-line (like continuous build), Eclipse Buildship, IntelliJ.

It would be a great thing because one should not have to tie herself/himself to any of the IDEs. Any answers/articles/videos are appreciated, it’s just I don’t know where to start. :slight_smile:

Thanks in advance!

Gabor

Hi Gabor,

this is one of the features on our sponsorship opportunities list for Buildship: Executing certain Gradle tasks on each auto build. You’d specify those tasks in your build file and Buildship would automatically execute them whenever the project is built in Eclipse.

IntelliJ doesn’t really have an “auto build” and instead runs external tools like javac. Android Studio already calls Gradle instead of running javac. So at least for Android projects you can already wire in tasks that need to be run. I’m not sure whether that is also possible for plain Java projects.

Cheers,
Stefan

I see. I’ll take a look into that, then. Thank you! :slight_smile: