Build a gradle module in an empty project

Answered

Hi all,

In my environment, I have several unrelated gradle projects. Because they are unrelated, I never attempted to add them to a traditional gradle multiproject.  So, to open them all in a intellij, I created an empty project and imported all my gradle projects as modules. Intellij is working fine for just about everything in the module (intellisense, debugging, etc...) except build. When attempting to build a specific module, it appears "gradle build" is never called. I can confirm this is the case as the build folder is never generated in the module directory. Is it possible to configure the module to call "gradle build" when attempting to build the module via intellij. Any Ideas?

0
2 comments
Avatar
Permanently deleted user

So I did some more digging and I found a few settings that helped me towards my goal by still not quite there. So I found "Delegate settings:" under

Build, Execution, Deployment > Build Tools > Gradle

I changed this to build and run using gradle. Now when I use ctr+F9 the module is being built with gradle (and the build folder is appearing).

 

However it appears that intellij is running its own build procedures as several of my task are not being executed on "gradle build."  According to this guide:

https://mrhaki.blogspot.com/2016/11/gradle-goodness-delegate-build-and-run.html 

Changing the runner setting should have fixed this particular issue but when I selected "Delegate IDE build/run actions to Gradle" nothing different seems to happen. Intellij is still running its own build procedure.

 

0

IntelliJ IDEA is not using grade build if the delegation is disabled. Also IntelliJ IDEA and Gradle will use different output folders: https://stackoverflow.com/a/46035904/104891.

What exactly is not executed on build with the delegation enabled that is executed in the command line build?

Please share a sample to reproduce: https://stackoverflow.com/help/mcve.

0

Please sign in to leave a comment.