Russel Winder wrote:
On Mon, 2009-07-20 at 09:34 +0200, Hans Dockter wrote:
[ . . . ]
But I can remember your email about the new << syntax :)
You have a better memory that I then :-)
I can believe I commented, it is an irritant :-(
The changes are tiny.
That is the problem though. The change is tiny, and not making the
change does not lead to an error just to very different semantics.
Replace:
<taskName> {
}
I think what needs to be done is for the semantics of this construct to
be made much clearly.
with
<taskName> << {
}
I don't have a problem with this per se, but I do have a problem with
both of the above being valid syntax but having such vastly different
semantics.
There are two audiences here, people coming from earlier version of
Gradle and people coming new to Gradle. I am not entirely convinced
either of these audiences are well catered for by the documentation just
at the minute.
I suspect that a "grey box" explaining the issues very early on in the
user guide might be a good move. Explain why the << in the very first
example perhaps?
A good idea. The << syntax is optional, it is simply a shorthand for:
task myTask
myTask.doFirst { some stuff }
or
task myTask {
doFirst { some stuff }
}
Perhaps we should present the 'hello world' example in the long form
first, and then later introduce the shorthand form.
Adam