Skip to content

Instantly share code, notes, and snippets.

@lordcodes
Created November 2, 2015 21:21
Show Gist options
  • Save lordcodes/0bc0a939cdbb9b738af5 to your computer and use it in GitHub Desktop.
Save lordcodes/0bc0a939cdbb9b738af5 to your computer and use it in GitHub Desktop.
Gradle function to print out the contents of an object
def void explainMe(it) {
println "Examining $it.name:"
println "Meta:"
println it.metaClass.metaMethods*.name.sort().unique()
println "Methods:"
println it.metaClass.methods*.name.sort().unique()
println "Properties:"
println it.properties.entrySet()*.toString()
.sort().toString().replaceAll(", ","\n")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment