`gradle.taskGraph.useFilter` not executing
I have the following in build.gradle:
def shouldExecute = { taskName ->
def propertyName = "${taskName}.dryrun"
!project.hasProperty(propertyName) || project[propertyName] != 'true'
}
gradle.taskGraph.useFilter({ task ->
println("*********************** ${task.name}:
${shouldExecute(task.name)}")
shouldExecute(task.name)
} as Spec)
But when I run gradlew -Ptest.dryrun=true clean build, I don't see the
output of println and the test task is still executed. Why isn't the
useFilter working?
No comments:
Post a Comment