On 3/04/10 3:55 AM, Spencer Allain wrote:
Started reading the latest version of the User Guide from the beginning and noticed this:

task hello {
     doFirst {
         println'Hello world!'
     }
}
task hello<<  {
     println'Hello world!'
}
Unless I'm mistaken, the second form is actually equivalent to:

task hello {
     doLast {
         println'Hello world!'
     }
}
or even
task hello
hello.doLast {
     println'Hello world!'
}


You're right. I've updated the sample (in trunk, not on the website yet).


The "<<" form is confusing enough. Having the first hello world example state that it's equivalent to doFirst will only lead to later confusion once a user learns about doFirst and doLast.


I think we should look at deprecating the '<<' form after the Gradle 0.9 release. And possibly doFirst() and doLast() too, so that a task has only 1 action.


--
Adam Murdoch
Gradle Developer
http://www.gradle.org

Reply via email to