Check for dependencies update with kotlin-dsl

Viewed 3532

This question has already been asked before, however the solution is still unknown... Kotlin DSL build scripts dependency updates

With the new implementation of kotlin-dsl. Now the imports looks like this.

implementation Koin.core
implementation Koin.android

and the buildSrc.

object Versions{
    const val koin = "2.0.1"
}

object Koin {
    val core = "org.koin:koin-core:${Versions.koin}"
    val android = "org.koin:koin-android:${Versions.koin}"
    val scope = "org.koin:koin-androidx-scope:${Versions.koin}"
    val viewModel = "org.koin:koin-androidx-viewmodel:${Versions.koin}"
    val extension = "org.koin:koin-androidx-ext:${Versions.koin}"
    val test = "org.koin:koin-test:${Versions.koin}"
}

in this case Koin is using a previous version, but i know that there's a new version https://github.com/InsertKoinIO/koin

anyone knows how to check if the dependencies has a newer version with kotlin-dsl?

1 Answers

I've tested this Gradle Dependencies Update Check Plugin on my Android/Kotlin DSL build (with a separate Versions class with versions definitions) and it works fine for me:

CheckDependencyUpdates Gradle Plugin

(I've also tested that it works with a traditional Groovy-DSL project)

To install the plugin (copied from linked page) add the following to your build.gradle.kts. Note that I've removed the version number from this as it will, unlike the page I've linked to, get out of date:

plugins {
  id("name.remal.check-dependency-updates")
}

To run the update check (copied from gradle tasks) run the following:

gradle checkDependencyUpdates

You will see an output section similar to the following:

New dependency version: com.android.tools.build:aapt2: 3.6.1-6040484 -> 3.6.3-6040484
New dependency version: com.android.tools.lint:lint-gradle: 26.6.1 -> 26.6.3
Related