r/java • • Mar 30 '21

The Problem with Gradle

https://www.bruceeckel.com/2021/01/02/the-problem-with-gradle/
48 Upvotes

48 comments sorted by

View all comments

3

u/transcend Mar 30 '21

I became happier with Gradle once I switched from Groovy to Kotlin DSL build files. I was never interested in learning Groovy TBH, and like the author of the article said, you can't really understand Gradle's DSL syntax unless you know Groovy and grok that Gradle's build files are actually scripts full of imperative programming. Switching to the Kotlin DSL syntax allows IntelliJ to infer variable types, and constrains the build file syntax a bit more.

4

u/dpash Mar 30 '21

Gradle gets even better when you keep task definitions out of your build.gradles. I highly recommend the talk that Cedric Champeau gave to the Madrid groovy users group last year on cleaning up the groovy build.

https://youtu.be/HXAV9pL5Rf8

1

u/transcend Mar 31 '21

Thanks very much for the link. I enjoyed the video and have started restructuring my project's build.gradle files as Cedric Champeau suggests, using plugins.

1

u/dpash Mar 31 '21

Once you're done, don't forget to use the scans to profile your build to prevent task creation, which can help improve the performance of your build.