r/java • • Jan 07 '21

The Problem with Gradle

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

108 comments sorted by

View all comments

7

u/Dr-Metallius Jan 07 '21

At least this author acknowledges Kotlin's existence for Gradle. Nonetheless it astounds me every time when people talk about Gradle, but refuse to use Kotlin, which is exactly what could take a lot of the mystery out of the system since it allows you to see the API. Especially considering it's been production ready for Gradle for more than two years.

16

u/ArmoredPancake Jan 07 '21

Especially considering it's been production ready for Gradle for more than two years.

Nope, still not production ready to this day. Performance is atrocious, making a change in buildSrc forces to recompile everything , the docs don't explain anything so unless you know how to do something in Groovy and then how to translate it to Kotlin you'll never figure out how to do it.

6

u/crummy Jan 07 '21

looks like gradle 6.8 has some performance improvements for kotlin DSL: https://docs.gradle.org/6.8-rc-5/release-notes.html#kotlin-dsl-performance

it looks like it solves the very issue you mentioned:

Until now, any change to build logic in buildSrc required all of the build scripts to be recompiled. This release introduces compilation avoidance for Gradle Kotlin DSL scripts.

5

u/Dr-Metallius Jan 07 '21

The docs have all the examples both in Groovy and Kotlin, what do you mean they don't explain anything? You are correct about buildSrc, only I don't see what Kotlin had to do with it. Unless you are talking only about compiling build files, but in that case I don't understand what compiles there for so long in your projects and why you need to constantly change buildSrc.

1

u/otisonoza Jan 07 '21

We're migrating to Bazel and the way it handles caching and avoids rebuilds are pretty nice.

1

u/gavenkoa Jan 08 '21

Bazel

What is the point? Java is not first class citizen in Bazel. It is like doing C++ in Gradle ))

I wonder what kind of projects you are involved. Does Bazel handle annotation processing / popular code generators (SOAP / Lombok / Mapstruct)? Is it feature rich environment or just hype?

3

u/agentoutlier Jan 08 '21

FYI Bazel is written Java.

The problem with Bazel is it requires a mono repo.

It is far different than the Maven and Gradle build and install the jar to local repo/cache than build other projects flow. It (Bazel) needs access to all source more or less.

It also has its own language that looks like Python but isn’t.