Hi Eric,

First of all, If you don't know if a cleanAll task exists in your build file, I'd definitely prefere creating a seperate delete task.

Am 23.08.10 23:40, schrieb Eric Berry:
Hi Rene,
That explains it. But, I'd like to use the '<<' notation in case there's already a "cleanAll" task defined. How would I go about keeping the "doLast" syntax and making it work? Do I need to then explicitly create my own delete task and execute it??

Eg.
task("cleanAll") << {
    def delete = new Delete()
    delete = delete.delete("some dir")
    delete.execute()
}
If you already have a task named cleanAll in your build script the snippet above won't work either. You'll get an error message, that a task named cleanAll already exists and can't be added to your project. you have to use the following syntax if the task already exists:

cleanAll <<{
    project.delete("some dir")
}

It seems that in both cases, you have to know if cleanAll is already defined anywhere in your build file. gradle has a concise syntax here. If you have defined a cleanAll task like this:

task("cleanAll", type:Delete) {
   delete("some dir")
}

you can add this to your script to define an additional directory that should be deleted by the cleanAll task

cleanAll{
    delete("some other dir")
}

--
------------------------------------
Rene Groeschke

[email protected]
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------


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

   http://xircles.codehaus.org/manage_email


Reply via email to