From 14cbe0416418ef1ff8e789dc5a01fb0ce0a38baa Mon Sep 17 00:00:00 2001 From: Walid Lezzar Date: Thu, 26 Mar 2020 14:52:49 +0100 Subject: [PATCH] fix bug in archives with jdk --- zoe-cli/build.gradle.kts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/zoe-cli/build.gradle.kts b/zoe-cli/build.gradle.kts index 48068a8..95bcc3b 100644 --- a/zoe-cli/build.gradle.kts +++ b/zoe-cli/build.gradle.kts @@ -19,6 +19,8 @@ mapOf( "zip" to Zip::class, "tar" to Tar::class ).forEach { (archiveType, archiveClass) -> + + // Archive application without JDK into zip/tar package tasks.register("${archiveType}DistWithoutJdk", archiveClass) { val installDistTask = tasks.getByName("installDist") @@ -32,21 +34,24 @@ mapOf( into("zoe") } -} -tasks.register("zipJpackageImage") { - val jPackageImageTask = tasks.getByName("jpackageImage") + // Archive application with JDK into zip/tar package + tasks.register("${archiveType}JpackageImage", archiveClass) { + val jPackageImageTask = tasks.getByName("jpackageImage") + + val sourceDir = with(jPackageImageTask.jpackageData) { "$imageOutputDir/$imageName" } + val outputDir = findProperty("$name.outputDir") ?: "$buildDir/jpackageImageArchive" + val suffix = findProperty("$name.suffix") ?: "" - val outputDir = findProperty("$name.outputDir") ?: "$buildDir/jpackageImageZip" - val suffix = findProperty("$name.suffix") ?: "" + dependsOn(jPackageImageTask) + from(sourceDir) - dependsOn(jPackageImageTask) - from(jPackageImageTask.distDir.asFile) + archiveFileName.set("zoe-${project.version}-with-jdk${suffix}.${archiveType}") + destinationDirectory.set(file(outputDir)) - archiveFileName.set("zoe-${project.version}-with-jdk${suffix}.zip") - destinationDirectory.set(file(outputDir)) + into("zoe") + } - into("zoe") } runtime {