blog.mikro2nd.net

Gradle Rant

Why is it? Every time — EVERY time — I pick up some open-source project to take a look at the code, and it uses gradle for its build system, the whole thing is a complete and utter shitshow?

I'm going through a pretty steep learning curve right now, and that means frequently wanting to look at some example code. So the answer's simple, right? You search around for some open-source projects related to what you want to do, you clone their repository and slurp it into your IDE or editor. Naturally the very first thing you want to do is run either their application (if that's what it is) or their tests, so a build is the first step.

Now if the build system is maven (or even ant) this is usually straightforward. There might be a compiler or JVM version issue, but that's quick and easy to resolve.

But if the build tool they used is gradle... oh woe! WOE! You're pretty much guaranteed to be fucked. And not in a good way. Without fail, gradle promptly disappears up its own arsehole, downloading a myriad of mysterious and opaque plugins, and then promptly (not really promptly; this is gradle, the process is not quick!) pukes out an incomprehensible error message, usually about incompatible versions of itself. I mean... what the actual fuck? When the build tool can't even manage to track its own versions and keep some level of backward compatibility, what hope is there that it's competent to do the same for your project? Now these are projects I'm casually looking at to try and learn something. I'm not invested, unlikely to ever be. So the chances of me rolling up my sleeves to debug the configuration of your crappy build system are somewhere between zero and fuck all.

rm -r $PROJECT and move on. I'll have to try and get my learning elsewhere.

I think the problem is that the developers who work on the project have their development environment and tooling set up and working, and it evolves over a long period of time with all the team stayin in step. Nobody on the team ever starts from a clean slate with a machine that potentially (likely!) has different versions of the tools, different choices and configurations in the environment, than their build-scripting expects, and they are quite unaware of the steepness of that get-going curve. It's sorta natural. But still frustrating.

But it's still funny — as in funny-peculiar, not funny-ha-ha — how maven (and even ant) build projects manage this quite well (not 100%, but close enough) while gradle builds are uniformly a disaster.