Why gradle changes itself too rapidly?

I’m an android developer and I’m tired because of gradle, even I cannot build my project from few months ago.
imagine the world if gradle doesn’t exists, it is beautiful.
what is my fault is become an android developer and android uses gradle, do you believe me? I had considered xamarin many times because it is the only one doesn’t use gradle when building android application.

why I’m so hate gradle? okay, lets summarize it together.

  1. first of all, why gradle introduces a new language called groovy? why can’t we just use python. javascript or even java for build scripts? because I’m an android developer should I master with groovy with java/kotlin at the same time right? if I’m not I cannot resolve thousands of build errors, what should I do? do my main job or learning a new language and spend days of time to upgrade/downgrade gradle version of my project just few months ago?

  2. yeah, finally I have no choose because android uses gradle and so flutter also uses gradle and finally I’m using gradle, I open gradle official website, watch documents, learn fundamentals, looks like gradle is nice but the problem comes future few months, suddenly you cannot build your android project because gradle needs to upgrade itself, plugin mismatch, jvm version mismatch, the plugin used by some dependencies mismatch, or something like that, if you upgrade your project gradle you have to learn a lot of new stuff, but just wait for few months, gradle will removes most of the thing in future releases so you need to learn new stuff intoruced by gradle.

  3. congratulations gradle, finally you makes a lot of job to do for us, developers doesn’t change single line of their code but they have to change the gradle version of their package otherwise I cannot use that package in my project, there are dozens of versions of gradle plugin in dozens of dependencies, nightmare.

what should I do?
don’t you tired to change gradle every day evert mongth, every year? but I do.
I need to maintain my android projects, please…

why gradle introduces a new language called groovy

Groovy is not a new language, it is a very old language and at the time Gradle was created, was an optimal choice for building a DSL.

because I’m an android developer should I master with groovy with java/kotlin at the same time right?

Actually, don’t use Groovy DSL, use Kotlin DSL. By now it is the default DSL, you immediately get type-safe build scripts, actually helpful error messages when you mess up the syntax, and amazingly better IDE support if you use a good IDE like IntelliJ IDEA or Android Studio.

suddenly you cannot build your android project because gradle needs to upgrade itself

Gradle never needs to upgrade itself.
If you use the Gradle wrapper - as practically any build should do, I consider not using it a build bug - then you can build your project reliably no matter when you touch it again, except if some other things are borked, but as far as Gradle itself is concerned, it will just work.

if you upgrade your project gradle you have to learn a lot of new stuff, but just wait for few months, gradle will removes most of the thing in future releases so you need to learn new stuff intoruced by gradle

Like with any library or tool you use. If you update it, you have to adapt to the changes that happened, that’s how software development with using other’s libraries or tools works.

If you need to update Gradle, luckily updating Gradle is usually not too much of an issue, if you follow this simple recipe:

  1. upgrade to the latest patch version within the same major version
  2. upgrade all plugins to the latest versions compatible with that Gradle version
  3. fix all deprecation messages
  4. upgrade to the latest patch version in the directly following major version
  5. go to step 2 and repeat until you are at your target version

Gradle does never (except maybe accidentally which will cause a bugfix release) do breaking changes within one major version intentionally, and will always first deprecate something before it is changed breakingly.

To recap, Gradle is under active development and is improved consistently. To improve, of course things need to change. If you don’t need the new things, don’t upgrade. If you need the new things, well, you have to learn them like with any other library or tool you use.

Thank you for reply
after your explanation I have developer renewed appreciation for gradle.

1 Like