buildscript { repositories { mavenLocal() mavenCentral() } dependencies { classpath 'org.xapek.yvesf:gradle-download-task:0.1-SNAPSHOT' } } task download(type: org.xapek.yvesf.gradle.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) } tasks.getByName('activator').dependsOn('untar') tasks.getByName('activator').doFirst { file("${buildDir}/unpacked/dist/bin").list().each { activator.bin[it] = "/opt/${project.name}/bin/${it}" } }