-
-
Notifications
You must be signed in to change notification settings - Fork 124
Home
Detailed guidance on how to use, and get the most out of, the Dependency Analysis Plugin.
We’ll get started with the primary use-cases the plugin supports. This plugin will tell you the following about your project:
-
Unused dependencies which should be removed.
-
Declared dependencies which are on the wrong configuration (
api
vsimplementation
vscompileOnly
). This is variant-aware, so it might tell you to usedebugImplementation
, for example. -
Transitively used dependencies which ought to be declared directly, and on which configuration.
-
Dependencies which could be declared on the
compileOnly
configuration, as they’re not required at runtime. -
Annotation processors which could be removed as unused.
-
Plugins that are applied but which can be removed.
This is printed to console in a narrative form, and also written to disk as JSON. The JSON output
has several components (see the com.autonomousapps.advice.Advice
model class):
-
Dependency (identifier, resolved version, and declared configuration, if any)
-
"fromConfiguration", which is the configuration on which the dependency is currently declared. Typically "api" or "implementation". If this field is not present, that means it is null and the dependency is transitive. It should be declared directly.
-
"toConfiguration", which is the configuration on which the dependency should be declared. If this field is not present, that means it is null and the dependency should be removed.
Additionally, the Advice
class includes
-
usedTransitiveDependencies: Set<Dependency>
for transitive dependencies that are used. -
parents: Set<Dependency>
for unused dependencies that contribute this transitive dependency.