

This is a Tom’s Obvious Minimal Language file.

However, we need to enable this feature in order to use it: dependencyResolutionManagement Īndroidx-compose = While they may not be in their final form, they seem to work quite nicely in my testing. Version Catalogs are a new incubating feature in Gradle. There is one small extra step required to get Version Catalogs to work with the Kotlin DSL, so by going this route, we can cover that when we come to it.However, I opted to go with the Kotlin DSL for two main reasons: I should mention that the following examples all use Kotlin DSL rather than Groovy DSL for the Gradle config files. The new Gradle feature overcomes this and also offers some other improvements. Changes to buildSrc require re-compilation and this is quite slow. While this works quite nicely, it can slow the build down. Having a single source of truth makes it much easier to maintain your app dependencies. the navigation-fragment and navigation-ui libraries have a common version. For example, two distinct libraries share the same lifecycle version in the linked example earlier – e.g.

It can also simplify things when multiple related dependencies share a common version. It can make it much easier to update a dependency to a new version in a multi-module project. This gives a single source of truth for all dependency versions. Most recently, I have been using a Dependencies.kt Kotlin file in the buildSrc directory. Regular readers of Styling Android may be aware that I like to organise my dependency versioning.
