import org.xapek.yvesf.gradle.DownloadTask version '2.10' task download(type: DownloadTask) { source "https://services.gradle.org/distributions/gradle-${project.version}-all.zip" sha256sum 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' } task unpack(type: Copy) { from zipTree(download.destFile) into file("${buildDir}/unpacked/dist") eachFile { FileCopyDetails fcd -> fcd.path = fcd.path.substring(path.indexOf('/')+1) } } unpack.dependsOn(download) ospackage { into "/opt/${project.name}" from unpack.outputs.files }