On Apr 20, 2011, at 5:59 PM, Adam Murdoch wrote:
> To fix your task, you can wrap the parameter to into in a closure:
> 
> into { getDeployLoc() }
> 
> and get rid of the doFirst { }
> 

Thanks Adam.  I forgot that I could use a closure there.  That is a much more 
elegant solution.

> Longer term, we want to provide something in the dsl to let you do some task 
> configuration only if the task is to be executed. One interesting option is 
> to make this the default, and defer all task configuration until the task is 
> selected for execution. That is:
> 
> task myTask(...) {
>    ... this code runs only if myTask is to be executed ...
> }
> 
> Even more interesting if the conditional configuration code can configure 
> stuff other than just the task in question. For example, you might do the 
> following, instead of using gradle.taskGraph.whenReady()
> 
> version = '1.0-SNAPSHOT'
> 
> task release {
>     dependsOn clean, build, upload
>     project.version = '1.0' // or version.replaceAll('-SNAPSHOT', '')
> }

I think that I like this idea.  This may have performance benefits in some 
cases too.

--
Steve Appling
Automated Logic Research Team





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to