Skip to content

Instantly share code, notes, and snippets.

@bennyhuo
Created November 4, 2021 03:55
Show Gist options
  • Save bennyhuo/363c480340a8b83c190c464987d0aa8c to your computer and use it in GitHub Desktop.
Save bennyhuo/363c480340a8b83c190c464987d0aa8c to your computer and use it in GitHub Desktop.
gradle.taskGraph.afterTask { task ->
StringBuffer taskDetails = new StringBuffer()
taskDetails << """"-------------
name:$task.name group:$task.group : $task.description
conv:$task.convention.plugins
"""
taskDetails << "inputs:\n"
task.inputs.files.each { it ->
taskDetails << "${it.absolutePath}\n"
}
taskDetails << "outputs:\n"
task.outputs.files.each { it ->
taskDetails << "${it.absolutePath}\n"
}
taskDetails << "dependencies: \n"
task.taskDependencies.getDependencies(task).each {
taskDetails << "$it\n"
}
taskDetails << "mustRunAfter: \n"
task.mustRunAfter.getDependencies(task).each {
taskDetails << "$it\n"
}
taskDetails << "shouldRunAfter: \n"
task.shouldRunAfter.getDependencies(task).each {
taskDetails << "$it\n"
}
taskDetails << "finalizedBy: \n"
task.finalizedBy.getDependencies(task).each {
taskDetails << "$it\n"
}
taskDetails << "-------------"
println taskDetails
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment