Hi Tomek,
On Aug 20, 2009, at 11:31 PM, Tomek Kaczanowski wrote:
Hi all,
I think the documentation should better explain the difference between
the configuration tasks and execution tasks. There are already few
posts/issues caused by the misunderstandings surrounding this
distinction, and I believe there will be more of them in the future:
http://www.nabble.com/Running-imported-ant-task-sequentially-td24845591.html#a2484559
http://www.nabble.com/%22gradle--t%22-tries-to-execute-Ant-tasks%2C-and-it-shouldn%27t-td24546981.html#a24547542
http://www.nabble.com/Running-imported-ant-task-sequentially-td24845591.html#a2484559
http://jira.codehaus.org/browse/GRADLE-513
http://jira.codehaus.org/browse/GRADLE-592
and probably many more
I think the differences between these two types of tasks should be
clearly presented somewhere in the first chapters of the userguide -
probably on the beginning of chapter 4 (Chapter 4. Build Script
Basics). Right now this chapter uses << notation without explanation
what it means. I think we should remember, that many users (or even
most of them) will not bother with reading the whole documentation,
but will start writing their builds after reading just a part of it.
And will be dissapointed with the results.
Should I add JIRA issue for this ?
Yes. I just would like to point out, that there are no two type of
tasks. There are two types of closures to be used with tasks. One in
conjunction with the << operator (someTask << { ... }) which is an
equivalent to the API call
createTask('someTask').doLast {}.
tasks.getTask('someTask').doLast {}
The other without the << operator (someTask { ... }, which is an
equivalent to the API calls:
createTask('someTask').configure {}
tasks.getTask('someTask').configure {}
The last closure is executed at configuration time and the delegate of
this closure is set to the task object. The first closure is called at
execution time and does not have the task object as delegate but can
task an task object as argument.
- Hans
--
Hans Dockter
Gradle Project Manager
http://www.gradle.org
--
best regards
Tomek Kaczanowski
http://kaczanowscy.pl/tomek
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email