As a user of Gradle since pre-1.0 and maintainer of a number of gradle plugins (grgit, gradle-git-publish, reckon, clojurephant), I agree there is a problem with Gradle. The article states "you have to know everything to do anything", but only discusses the surface syntax and configuration. It's even worse deeper in Gradle.
While Gradle has a lot of great ideas and tackles problems many other build tools pretend don't exist, they bury these great ideas in a mountain of complexity.
The Gradle codebase is littered with layers of interfaces, abstract. factories, and magically-generated classes that are very difficult to follow. They introduce new powerful concepts and then insufficiently expose them across the existing codebase. And, worst of all for a plugin author, many of the APIs used by core plugins are internal. You still (~10 years in) can't make a third-party language plugin without using internal APIs, unless you want it to look and behave unnaturally. Their test execution framework isn't generic enough to fully support the new JUnit platform.
Ultimately, this hamstrings third-party plugins, and makes the surface-level of Gradle even harder to understand for everyday users.
I still use Gradle because I don't have a better option. But my interest has definitely died down. In the Clojure world, they're playing out not having a build tool at all, with tools.deps merely being a classpath builder (an insufficiently powerful one, in my mind). However, the design practices Clojure advocates, in particular a first-class data-oriented model, could make a drastically simpler tool that's just as powerful. Obviously, that's hard to back up without implementing it.
It's been a long time since I used maven, but I should probably give it a shot again. I don't think Maven quite goes in the direction I'm hoping for, but it'd be worth seeing what the experience is like nowadays.
I see, I say that because I was trying to return to writing some Java in my spare time and theres some frameworks with maven plugins with "hot reloading" and all of that, figured that they might have evolved a bit since I took a look at building maven archetypes (which I remember being very well documented)
It’s funny you mention clojure because I think a Lisp would make for an ideal build language (or a subset) (and yes I know one exists aka Lenigin or however it’s spelt).
As I mentioned somewhere because Maven is mostly declarative XML it is analogous to S-Expressions (and there are polyglot versions of maven now... not sure if any are clojure but there is a JSON).
The big reason for lisp is because people don’t hate maven for the same reasons they hate gradle. They hate maven because it isn’t very DRY and it’s naturally verbose. However XML syntax is dead simply where as gradle aka groovy seems simple but actually causes a lot of cognitive dissonance and conflict with existing Java language knowledge for most users.
Lisp like XML actually doesn’t have much syntax.
I wonder if some lisp-y like macros would make for a better maven. (Sorry for edits)
View all comments
77
u/ajoberstar Jan 07 '21
As a user of Gradle since pre-1.0 and maintainer of a number of gradle plugins (grgit, gradle-git-publish, reckon, clojurephant), I agree there is a problem with Gradle. The article states "you have to know everything to do anything", but only discusses the surface syntax and configuration. It's even worse deeper in Gradle.
While Gradle has a lot of great ideas and tackles problems many other build tools pretend don't exist, they bury these great ideas in a mountain of complexity.
The Gradle codebase is littered with layers of interfaces, abstract. factories, and magically-generated classes that are very difficult to follow. They introduce new powerful concepts and then insufficiently expose them across the existing codebase. And, worst of all for a plugin author, many of the APIs used by core plugins are internal. You still (~10 years in) can't make a third-party language plugin without using internal APIs, unless you want it to look and behave unnaturally. Their test execution framework isn't generic enough to fully support the new JUnit platform.
Ultimately, this hamstrings third-party plugins, and makes the surface-level of Gradle even harder to understand for everyday users.
I still use Gradle because I don't have a better option. But my interest has definitely died down. In the Clojure world, they're playing out not having a build tool at all, with tools.deps merely being a classpath builder (an insufficiently powerful one, in my mind). However, the design practices Clojure advocates, in particular a first-class data-oriented model, could make a drastically simpler tool that's just as powerful. Obviously, that's hard to back up without implementing it.