On 30/09/2011, at 4:46 PM, Eitan Suez wrote:
> i was wondering..if a task consists of a series of invocations of
> copy, is the copy task smart enough to register inputs and outputs
> onto the parent task? it seems that the inputs and outputs can be
> inferred from the copy specification.
If you use an actual Copy task instead of a series of manual copy {}
invocations then Gradle will infer the inputs and outputs, including task
dependencies…
task createStuff {
stuff = file("$buildDir/stuff")
outputs.dir stuff // register this dir as our output
doLast {
new File(stuff, "foo.txt") << "bar"
}
}
task copyStuff(type: Copy) {
from createStuff.outputs.files
into file("$buildDir/copiedStuff")
}
Gradle is smart enough to now know that copyStuff has an implicit task
dependency on createStuff, and will also do the appropriate up to date checking.
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email