method/build.gradle :
task test << {
def files = file('.').listFiles().sort()
files.each { File file ->
if (file.isFile()) {
println " *** $file.name ***"
}
}
}
Run command gradle -q test
to see the result:
*** build.gradle ***
ReportingExtension.file(String)
: API
File.listFiles()
: API
From now, we practice how to find the corresponding method in documentation and gradully learn the skill of groovy and gradle.