The Dependency Analysis Gradle Plugin (née Dependency Analysis Android Gradle Plugin) detects the following:
-
Unused dependencies.
-
Used transitive dependencies (which you may want to declare directly).
-
Dependencies declared on the wrong configuration (
api
vsimplementation
vscompileOnly
, etc.). -
Unnecessary plugins (currently only
kapt
).
As a side effect, the plugin can also tell you your project’s ABI, and produces graphviz files representing various views of your dependency graph, among other things. These side effects are currently mostly undocumented internal behaviors, but they may be interesting for some advanced users.
For detailed instructions, see the wiki
The simplest approach is to add the following:
plugins {
id 'com.autonomousapps.dependency-analysis' version "<<latest_version>>"
}
For a quick start, just run the following:
./gradlew buildHealth
The following is a list of articles / blog posts that have been published discussing this plugin:
…with more to come :)
This plugin has also been featured in these newsletters: