Execute Task upon IntelliJ Gradle Sync

I really like the Gradle integration with IntelliJ IDEA. The way the automatic Gradle Sync works is awesome.

But is it possible to execute some Gradle task always upon the IntelliJ IDEA Gradle Sync? The use case is that there are various generated source files which I would like to generate during Gradle Sync so that after the Gradle Sync, the project compiles and just works within IntelliJ IDEA.

You can configure that in the Gradle view of IDEA at the moment.

We are talking with the JetBrains devs to make it possible to define the tasks to run in your Gradle build in the future, so you don’t need to configure this again every time you import.

1 Like