Is there an option for gradle dependencies to show just the list of libraries

Viewed 211

Is there a short form? Instead of dependencies, can we see just a flat list of libraries used? ./gradlew -help doesn't show anything on this. Something like:

org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.3.7
com.android.support:recyclerview-v7:28.0.0
...
2 Answers

print the class path that you need to compare - once before and once after the change - then you can do diff

task runCP() {
    doLast {
        def runList = configurations.runtimeClasspath.asList()
        def compileOnlyList = configurations.compileOnly.asList()
        println(runList.join("\n"))
        println("----")
        println(compileOnlyList.join("\n"))
        println("====")
    }
}

if ./gradlew app:dependencies does not work for you, Gradle Enterprise does provide dashboard for comparing 2 builds (for example if you have 2 builds from different commits). From the dashboard you can see if the version was changed, or there are new library added. It also showing all configuration type, e.g. annotationProcessorClasspath, compileClasspath, RuntimeClasspath, etc. But it is not free.

Related