What's new in Gradle 5.2-5.5 (for mobile developers)
Tags: gradle, android, kotlin, build
Published: 2020-03-22 10:12:54

On our road through history of Gradle versions and their value to mobile developers we already stop at [Gradle 5.0](https://dev.to/xsveda/what-s-new-in-gradle-5-0-for-mobile-developers-45en) and [Gradle 5.1](https://dev.to/xsveda/what-s-new-in-gradle-5-1-for-mobile-developers-5ca8). 
In this post I'd like to summarize minor updates in Gradle 5.2 - Gradle 5.5 versions together as they do not add much to our story individually.

## Gradle 5.2 ([docs](https://docs.gradle.org/5.2/release-notes.html)) - February 2019
The only mentionable change is a package of [Annotation processor improvements](https://docs.gradle.org/5.2/release-notes.html#annotation-processor-improvements) that makes your life together with them a little bit easier.

## Gradle 5.3 ([docs](https://docs.gradle.org/5.3/release-notes.html)) - March 2019
There are two features I'd like to point out, that won't affect your project builds directly, rather being important for the future enhancements.

### Type-safe accessors in precompiled script plugins ([docs](https://docs.gradle.org/5.3/release-notes.html#type-safe-accessors-in-precompiled-script-plugins))
Behind this mouthful set of Gradle specific buzzwords is a technical change that simplifies the way how to structure the build logic.
This topic is a candidate for a blog post on its own, but in short it is about moving all the Gradle build logic pieces out of your `build.gradle.kts` files to `buildSrc` directory which is a so called "included build" for *every* Gradle project. 
Till then, Gradle User Guide has a standalone page for this topic called ["Organizing Gradle Projects"](https://docs.gradle.org/current/userguide/organizing_gradle_projects.html).

### Gradle Module Metadata 1.0 ([docs](https://docs.gradle.org/5.3/release-notes.html#gradle-module-metadata-1.0))
Gradle Module Metadata (GMM) were created as a replacement for Maven `pom.xml` files as those are simply not rich enough to solve many dependency management problems.
This is not something that mobile developers will directly work with every day. The main reason I'm excited about this is it allows building Kotlin Multiplatform projects with Gradle. From the [docs](https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html):

> The publications of a multiplatform library may include a special 'root' module that stands for the whole library and is automatically resolved to the appropriate platform-specific artifacts when added as a dependency, as described below.

Gradle will automatically consume published Gradle Metadata, but publications don't include any module metadata by default. To enable it , add `enableFeaturePreview("GRADLE_METADATA")` to the root project's `settings.gradle.kts` file.

## Gradle 5.4 ([docs](https://docs.gradle.org/5.4/release-notes.html)) - April 2019
Android developers don't need to care about this release as both *Support running Gradle with JDK12* (not much used among Android developers) and *Support for Swift 5* ([samples](https://github.com/gradle/native-samples)) do not really matter to them.

## Gradle 5.5 ([docs](https://docs.gradle.org/5.5/release-notes.html)) - June 2019

If you work in a large organization that distributes custom Gradle binaries for its internal purposes (yeah, it happens), you can now define the organization-wide `gradle.properties` that will configure Gradle environment for everyone who is using such distribution.
This configured properties have the lowest precedence of any `gradle.properties` and properties defined in other locations will override values defined here.

I will cover the Gradle 5.6 version (last release for Gradle 5.x) in the next post.