Ah, the lovely "configuration phase" vs. "execution phase" issue comes up
again.  Don't worry, this one confuses everyone at first.

Try this script out:

task foo { println "in configuration of foo" }
foo << { println "in execution of foo" }
task bar { println "in configuration of bar" }
bar << { println "in execution of bar" }

Now, run "gradle foo" and you'll see "in configuration of" foo and bar, but
only "in execution of" foo.

In your example, "clean" is defining a configuration closure, so it will
always run.  What you probably wanted was an execution closure:

clean << { println "in clean task" }

I hope that helps.  The Gradle documentation has some stuff about these
"phases", which might make more sense now.  :)


-- 
John Murph
Automated Logic Research Team

Reply via email to