If I want to copy files within a task, I can do something like this
task prepareDirectory() {
copy {
from 'jobs'
into "$buildDir/tmp/foo"
}
copy {
from configurations.compile
into "$buildDir/tmp/foo/lib"
}
}
Now I want to turn that foo
directory into a tarball. Of course, I can do this
task assembleTar(type: Tar) {
from "$buildDir/tmp"
compression 'gzip'
extension 'tar.gz'
exclude '**/.keepdir'
}
However it is in a different task. Can I put it into the same task?