Hey,

I have these tasks:

def my_dir = "test_dir"

task A(type: Delete) {
delete = my_dir
}

task B(dependsOn: "A") {
outputs.upToDateWhen {
file(my_dir).exists()
}
doFirst {
ant.mkdir dir: my_dir
}
}

I was assuming that when a task is up-to-date its dependencies wouldn't be 
executed. However, B is never up-to-date because the upToDateWhen closure is 
executed before B is executed but not before A is executed. A is always 
executed 
regardless of B's outputs.

Is there a way of avoiding B's dependencies are executed when its outputs are 
up-to-date?

Thanks

Steven


      

Reply via email to