Hi Brian,
On 29/08/2011, at 9:59 PM, Carr, Brian M wrote:
> 2.) clean<TaskName> cleans anything defined as an output of a task. however,
> outputs for a task can't be defined in the actual task closure, though ti
> doesn't throw an error.
>
> ex.
>
> task foo << {
> outputs.dir(blah)
> }
>
> doesn't throw an error, but also doesn't successfully define the outputs. I
> guess this is obvious if you think about it hard enough since the closure
> doesn't get executed during the cleanFoo task. Just a gotcha that wasn't
> obvious to me until I wasted far too much time on it.
This would work if this was written as:
task foo {
outputs.dir(blah)
}
The difference is that the “<<” version adds the closure as the list of things
to do (it's a shortcut for foo.doLast()) while the version just above
configures the foo task. So when running “cleanFoo”, “blah” is never going to
be added to the task's outputs because the “foo” task is not going to be run.
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email