Hi all,
I am new to gradle, and am having troubles understanding the order in
which tasks are run, and what the various keywords (as obvious as they
sound) actually mean.
For example:, the very first example in the groovy documentation:
task hello {
doLast {
println 'Hello world!'
}
}
What is the doLast block doing in the hello task? Does this mean that
the "Hello world" printout will be the last even to occur in the hello
task?
So, if we have:
task hello {
println 'do it then!'
doLast {
println 'goodbye world'
}
println 'do it now!'
doFirst {
println 'Hello world!'
}
}
we do indeed see things done in the order
do it then!
do it now!
hello world
goodbye world
--------------------------
But what exactly is the use of determining the order of things running
WITHIN a task in this way. Shouldn't it just be iterative ... step by
step..... what comes first gets done first like in as a c program?
I ask this not in criticism, only to point out where I need the help
in understanding the new paradigm.
Another example shown in the documentation:
task hello << {
println 'Hello Earth'
}
hello.doFirst {
println 'Hello Venus'
}
hello.doLast {
println 'Hello Mars'
}
hello << {
println 'Hello Jupiter'
}
shows the output as:
> gradle -q hello
Hello Venus
Hello Earth
Hello Mars
Hello Jupiter
------------------
This completely throws me. I would have expected that "Hello Mars" is
done last (since it is shown as a doLast).
Why is it not the case?
And I can't really find where it is documented what exactly the
difference between saying:
task hello {
println "do this now"
}
or
task hello <<{
println "do this now"
}
I haven't found something in the doco that explains it in ....
well,... .the way my own dull mind accepts.
Can anyone enlighten me?
thanks in advance!
sean
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email