Slackbot
09/28/2022, 2:26 PMMikhail Lopatkin
09/28/2022, 3:30 PMdef printFoo() {
println "foo"
}
task check {
doLast {
printFoo()
}
}
But this would:
class Foo {
static def printFoo() {
println "foo"
}
}
task check {
doLast {
Foo.printFoo()
}
}
The relevant issue is https://github.com/gradle/gradle/issues/20126
Of course, if printFoo
invokes methods of Project
, it won't work properly, for the same reasons Task.getProject
is disallowed at the execution time when configuration caching is enabledEug
09/28/2022, 3:37 PM