I have an IntelliJ IDEA Gradle project using JPA2 Metamodel generation with the JpaModelgen Gradle Plugin (similar configured as here) To get the Java files generated I have to trigger the specific task manually. Is there any way to include a Gradle task into the IntelliJ project build process?
Asked
Active
Viewed 2,067 times
3
-
2You can configure any Gradle task to run automatically before compilation (and on some other events). Check the task context menu in the Gradle tool window. – CrazyCoder Jun 23 '17 at 10:13
-
Thanks, this is already helping a lot! Is there also a way to do this on the fly? For instance, I'm also using Lombok for automatic getter / setter generation. Here the getters and setters are generated as soon as I change a @Data class. I've already enabled "Build automatically", yet this is not done as long as the application is running. – Alex Jun 23 '17 at 15:35
-
http://mrhaki.blogspot.ru/2016/11/gradle-goodness-delegate-build-and-run.html may help. – CrazyCoder Jun 23 '17 at 15:43
-
@CrazyCoder Enabling "Delegate IDE build/run actions to gradle" didn't show any effect unfortunately – Alex Jun 26 '17 at 11:17
-
Try adding `-Dcompiler.automake.allow.when.app.running=true` in `Help` | `Edit Custom VM Options…` – CrazyCoder Jun 26 '17 at 11:28
-
II guess that's for enabling "Build automatically" during run/debug, right? Because this is not the problem. Yet the automatic build seems not to do the same as the "Build Project" action (Ctrl F9). – Alex Jun 28 '17 at 13:30
-
1Responsible developer has confirmed that potentially slow external tasks (like Gradle, Maven or Ant) that are configured to run before compilation are intentionally disabled for automatic build mode for performance reasons. If you need an option to enable it, request is welcome at https://youtrack.jetbrains.com/issues/IDEA. – CrazyCoder Jun 28 '17 at 13:32
-
1Thanks for your support, I've created an issue: https://youtrack.jetbrains.com/issue/IDEA-175165 – Alex Jun 29 '17 at 08:43