import org.gradle.distribution.DownloadGradle

apply plugin: 'base'
version = '0.1'

task downloadGradle(type: DownloadGradle) {
    description = 'Downloads the Gradle distribution with a given version.'
    gradleVersion = '4.6'
}

task createCustomGradleDistribution(type: Zip) {
    description = 'Builds custom Gradle distribution and bundles initialization scripts.'
    dependsOn downloadGradle
    archiveName "mycompany-gradle-$downloadGradle.gradleVersion-bin.zip"
    from zipTree(downloadGradle.destinationFile)
    from('src/init.d') {
        into "$downloadGradle.distributionNameBase/init.d"
    }
}
