|Love It or Hate It, Gradle Reaches Version 7.0|
|Written by Nikos Vaggalis|
|Thursday, 15 April 2021|
Gradle is a tool that always stirs arguments among developers. Let's see what version 7 brings and breaks.
I first encountered Gradle when developing on Android and my first impression was that it wasn't the most friendly of tools; cryptic syntax, contradictory terms (see compile versus implementation) and peculiar blocks of elements.
The Groovy to Kotlin DSL jump is another testament to the tool's Android roots and as the platform evolved so has Gradle. After Android I've used Gradle in the all-Maven world of Spring Boot world and it really felt at odds, making my life miserable at times as I juggled the syntax, the plugins and the dependencies.
After everything finally clicked together, I got into "if it works,do not fiddle with it" mentality, fearing that the slightest change might break my build. In contrast, for those kind of Java projects, I've found Maven easier to use and comprehend due to its concrete structure and more obvious ways of doing things.
I think that my case resonates in general and it really all comes down to Bruce Eckel's saying:
And, of course, the fact is that almost every version upgrade breaks ties with the past. I cannot use an older version of Gradle to compile a project built with a newer one. I guess you could say that this is solved with the wrappers, but still..
In any case, a new version 7.0 has just been released, so let's take a look at what it brings and what it breaks.
First of all it brings support for Java 16. Then there's:
Also. it sponsors a new feature called "version catalogs" which simplifies version management in that it shares dependency versions between projects.
The version catalogs are shared by and are accessible by all projects of a build, therefore their main advantage is that when you introduce a dependency version it gets replicated for each project.
Version catalogs is experimental and can be enabled by editing the settings.gradle and enabling:
Of course, as always, there are breaking changes as well:
There's a whole guide on upgrading from version 6x to 7.0, and of course 160 bug fixes.
These are the most important changes but there's a whole lot more which can be found in 7.0's release notes.
So in the end is Gradle's version 7 a necessity in order to catch up with the developments of the Android platform, as such it is still mostly Android oriented.
Are pro or anti using Gradle, and are you using it in non-Android projects too? Leave a comment below to let us know.
or email your comment to: email@example.com
|Last Updated ( Thursday, 15 April 2021 )|