The dependency-reporting
plug-in is a convention plug-in which is intended to apply standard tasks for task types provided by the Gradle APIs related to dependency reporting. It is intended for use on multi-module projects - for single-module projects, Gradle provides the similar dependencies
and dependenciesInsight
tasks
Apply the plug-in via the buildscript classpath:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath group: 'org.starchartlabs.flare', name: 'flare-operations-plugins', version: '3.0.1'
}
}
apply plugin: 'org.starchartlabs.flare.dependency-reporting'
Three tasks are provided by the plug-in:
Applies Gradle's DependencyReportTask, allowing output of the full dependency tree of the project(s)
Applies Gradle's DependencyInsightReportTask, which allows determination of where a dependency is introduced. Takes two arguments
--configuration
- The Gradle configuration to search for instances of the given dependency in. (Ex:
runtime
)
- The Gradle configuration to search for instances of the given dependency in. (Ex:
--dependency
- All or part of the dependency name to find (Ex:
org.testng
,testng
)
- All or part of the dependency name to find (Ex:
Applies Gradle's DependencyInsightReportTask, with a matching specification configured to match any projects in a multi-module environment
--configuration
- The Gradle configuration to search for instances of the given dependency in. (Ex:
runtime
)
- The Gradle configuration to search for instances of the given dependency in. (Ex:
The plug-in has the effect of replacing the boilerplate:
task dependencyFullReport(type: DependencyReportTask) {}
task dependencyDetailReport(type: DependencyInsightReportTask) {}
task dependencyProjectDetailReport(type: DependencyInsightReportTask) {
spec = new ProjectDependencyResultSpec(project)
}