With regards to this question: https://stackoverflow.com/questions/40172625/passing-a-closure-in-a-plugin-extension-in-gradle.
In build.gradle
apply plugin: TestPlugin
testConfig {
closure = { println "Modified closure!!" }
}
Run the test
task.
Why does the closure not get called when simply invoked, but only gets called when explicitly called with .call()
?
Similar question asked on Stackoverflow: https://stackoverflow.com/questions/56467564/why-does-directly-calling-groovy-closure-not-work-but-using-call-does