In Gradle Groovy root build.gradle
I have some method defined. For example:
File[] getFiles(String path) {
// do some filtering here and return result array
return result
}
In module build.gradle
I have some task defined which calls method above. For example:
tasks.register("copyFiles") {
doLast {
for (String path : pathList) {
File[] files = getFiles(path)
// do something with returned files
}
}
}
In Groovy it is all right. Now I am converting only root build.gradle
to Kotlin DSL build.gradle.kts
.
I have tried some attempts with setting lambda to extra properties, but without success. They usually fails with exception:
Could not find method getFiles() for arguments ...
Thanks for your advice.