import org.xapek.yvesf.gradle.DownloadTask subprojects { task download(type: DownloadTask) {} task untar(type: Copy) { into file("${buildDir}/unpacked/dist") eachFile { FileCopyDetails fcd -> fcd.path = fcd.path.substring(path.indexOf('/') + 1) } } untar.dependsOn(download) ospackage { from untar.outputs.files } project.afterEvaluate { untar.from tarTree(download.destFile) } }