Steve Appling wrote:
<clip ...>
There is actually a problem with this that I had not noticed related to
coding conventions and curly brackets.
previously we used:
createTask('myCopy', type:Copy).configure
{
from file('mysrc')
into file('mydest')
}
but this won't work:
task myCopy(type:Copy)
{
from file('mysrc')
into file('mydest')
}
This fails with:
Could not compile build file 'C:\test\gradleconfig\build.gradle'.
Cause: startup failed, build_gradle: 8: Ambiguous expression could be a
parameterless closure expression, an isolated open code block, or it may
continue a previous statement;
I can only get the new task syntax for configuration to work if we put
the curly bracket on the same line as the task like:
task myCopy(type:Copy) {
from file('mysrc')
into file('mydest')
}
As Hans pointed out to me, this will work fine (and be more consistent with how
configuration works elsewhere) if I change my use of parenthesis.
We can use:
task(myCopy, type:Copy)
{
// configure here
}
--
Steve Appling
Automated Logic Research Team
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email