Skip to content

Instantly share code, notes, and snippets.

@s1rius
Last active August 16, 2023 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s1rius/5cd0a4fa8473852a4a2706e4bcb46e7c to your computer and use it in GitHub Desktop.
Save s1rius/5cd0a4fa8473852a4a2706e4bcb46e7c to your computer and use it in GitHub Desktop.
Print task input and output files when execute
gradle.taskGraph.afterTask { task ->
StringBuffer taskDetail = new StringBuffer()
taskDetail << """---
name: $task.name group: $task.group $task.description
inputs:
"""
task.inputs.files.each { it ->
taskDetail << "${it.absolutePath} \n"
}
taskDetail << "outputs: \n"
task.outputs.files.each { it ->
taskDetail << "${it.absolutePath} \n"
}
taskDetail << "---"
println taskDetail
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment