Skip to content

Commit

Permalink
fix bug in archives with jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Walid Lezzar committed Mar 26, 2020
1 parent 0947a68 commit 14cbe04
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions zoe-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Sync>("installDist")

Expand All @@ -32,21 +34,24 @@ mapOf(

into("zoe")
}
}

tasks.register<Zip>("zipJpackageImage") {
val jPackageImageTask = tasks.getByName<JPackageImageTask>("jpackageImage")
// Archive application with JDK into zip/tar package
tasks.register("${archiveType}JpackageImage", archiveClass) {
val jPackageImageTask = tasks.getByName<JPackageImageTask>("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 {
Expand Down

0 comments on commit 14cbe04

Please sign in to comment.