Is there a way to get a report of exactly what the input and output are for all the tasks, as a hint of why one task might depend on another? Maybe a kind of report, way more than “./gradlew tasks --all”. “–info” would be an appropriate place, but I’m finding that --info barely adds anything useful, and “–debug” is 90% Wharf/cache related which is rarely relevant to a release engineer and it still doesn’t provide the basics of how the graph was built.
I’m consistently having hindrances when diagnosing a Gradle project. It always starts simply and I can see what tasks are available and what tasks will be run. Then I hit a rock wall of “ok, but why is that depending on that?”. With the continued focus on tasks having inputs and outputs to drive the graph (ala Google’s Blaze), it seem extremely pertinent to expose this. The more time I spend with Gradle the more I get scared that there’s too much magic and I can’t figure out why something is happening.
I written the following to help myself but I was hoping there was something better out there:
gradle.taskGraph.whenReady {TaskExecutionGraph taskGraph ->
println “Tasks:”
project.getAllTasks(false).get(project).each {Task task->
println " $task group:$task.group : $task.description"
println "
conv:$task.convention.plugins"
println "
inputs:${task.inputs.getFiles().getFiles()}"
println "
outputs:${task.outputs.getFiles().getFiles()}"
print
"
dependsOn:["
task.dependsOn.each{
if (it instanceof FileCollection)
print “${it.getAsPath()},”
else
print “$it,”
}
println “]”
println "
actions:"
task.actions.each {Action action->
println "
$action"
}
}
} }