buildscript { repositories { mavenLocal() mavenCentral() } dependencies { classpath 'org.xapek.yvesf:gradle-download-task:0.1-SNAPSHOT' } } task download(type: org.xapek.yvesf.gradle.DownloadTask) {} task unzip(type: Copy) { into file("${buildDir}/unpacked/dist") eachFile { FileCopyDetails fcd -> fcd.path = fcd.path.substring(path.indexOf('/')+1) } } unzip.dependsOn(download) ospackage { into "/opt/${project.name}" from unzip.outputs.files } project.afterEvaluate { unzip.from zipTree(download.destFile) }