Skip to content

Commit

Permalink
Adds release task
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlyzzz committed May 23, 2021
1 parent ae90eb9 commit 9bd4e4a
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.5.0"
kotlin("plugin.serialization") version "1.5.0"
// id("org.mikeneck.graalvm-native-image") version "1.4.0"
id("com.palantir.graal") version "0.7.2"

application
Expand Down Expand Up @@ -37,33 +36,19 @@ tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}

val binaryName = "awsetup"

graal {
graalVersion("21.1.0")
javaVersion("11")
outputName("awsetup")
outputName(binaryName)
mainClass(appMain)
option("--no-fallback")
}

//nativeImage {
// graalVmHome = System.getenv("JAVA_HOME")
// buildType {
// it.executable(appMain)
// }
// executableName = "awsetup"
// outputDirectory = file("$buildDir/bin")
// arguments(
// "--no-fallback",
// "--enable-all-security-services",
// "--report-unsupported-elements-at-runtime"
// )
//}

tasks.withType<Jar> {
manifest {
attributes["Main-Class"] = application.mainClass
}
configurations["compileClasspath"].forEach { file: File ->
from(zipTree(file.absoluteFile))
}
tasks.register<Zip>("release") {
dependsOn("nativeImage")
archiveFileName.set("release.zip")
destinationDirectory.set(layout.buildDirectory.dir("dist"))
from(layout.buildDirectory.file("graal/$binaryName"))
}

0 comments on commit 9bd4e4a

Please sign in to comment.