packsquashstep/build.gradle
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
implementation project(':core')
implementation project(':packexport')
}
def packSquashDir = toolDir.toPath().resolve('packsquash').toFile()
def packSquashRepo = "https://raw.githubusercontent.com/ComunidadAylas/PackSquash/master"
def packSquashReleases = "https://github.com/ComunidadAylas/PackSquash/releases/download/$packSquashVersion"
task downloadLicense(type: Download) {
src "$packSquashRepo/LICENSE"
//noinspection GroovyAssignabilityCheck
dest new File(packSquashDir, 'LICENSE')
overwrite false
}
task downloadReadMe(type: Download) {
src "$packSquashRepo/README.md"
//noinspection GroovyAssignabilityCheck
dest new File(packSquashDir, 'README.md')
overwrite false
}
task downloadLinux(type: Download) {
src "$packSquashReleases/PackSquash.executable.Linux.zip"
dest new File(buildDir, 'PackSquash.executable.Linux.zip')
overwrite false
}
task downloadMacOS(type: Download) {
src "$packSquashReleases/PackSquash.executable.macOS.zip"
dest new File(buildDir, 'PackSquash.executable.macOS.zip')
overwrite false
}
task downloadWin(type: Download) {
src "$packSquashReleases/PackSquash.executable.Windows.zip"
dest new File(buildDir, 'PackSquash.executable.Windows.zip')
overwrite false
}
task unzipLinux(dependsOn: downloadLinux, type: Copy) {
from zipTree(downloadLinux.dest)
into packSquashDir
rename('packsquash', 'packsquash-linux')
}
task unzipMacOS(dependsOn: downloadMacOS, type: Copy) {
from zipTree(downloadMacOS.dest)
into packSquashDir
rename('packsquash', 'packsquash-macos')
}
task unzipWin(dependsOn: downloadWin, type: Copy) {
from zipTree(downloadWin.dest)
into packSquashDir
rename('packsquash.exe', 'packsquash.exe')
}
rootProject.tasks.getByName('run').with {
dependsOn downloadLicense
dependsOn downloadReadMe
dependsOn unzipLinux
dependsOn unzipMacOS
dependsOn unzipWin
copy {
from "../build/tools"
into '../run/tools'
}
}
distZip.with {
dependsOn downloadLicense
dependsOn downloadReadMe
dependsOn unzipLinux
dependsOn unzipMacOS
dependsOn unzipWin
}