Skip to content

Commit

Permalink
Try jlink-application for creating a distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Scholz committed Nov 22, 2023
1 parent c87146c commit 849d21c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/createStandaloneApp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
distribution: 'temurin'
- name: Echo JAVA_HOME
run: echo $JAVA_HOME
- name: Execute qr-code-app:runtime
run: ./gradlew --info --stacktrace qr-code-app:runtime
- name: Execute qr-code-app:installDist
run: ./gradlew --info --stacktrace qr-code-app:installDist
- uses: actions/upload-artifact@v3
with:
name: qr-code-app-${{ matrix.os }}
path: qr-code-app/build/qr-code-with-logo-app/
path: qr-code-app/build/install/qr-code-with-logo-app/
40 changes: 18 additions & 22 deletions qr-code-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,7 @@ plugins {
id("com.github.ben-manes.versions")

id("org.graalvm.buildtools.native") version "0.9.28"
id("org.beryx.runtime") version "1.12.7"
}

distributions {
main {
distributionBaseName = "qr-code-with-logo-app"
}
}

runtime {
addOptions("--strip-debug", "--compress", "2", "--no-header-files", "--no-man-pages")
imageDir = file("${layout.buildDirectory.asFile.get().name}/qr-code-with-logo-app")
imageZip = file("${layout.buildDirectory.asFile.get().name}/qr-code-with-logo-app.zip")

launcher {
noConsole = true
}
jpackage {
val currentOs = org.gradle.internal.os.OperatingSystem.current()
val imgType = if (currentOs.isWindows) "ico" else if (currentOs.isMacOsX) "icns" else "png"
imageOptions = listOf("--icon", "src/main/resources/app_icon.$imgType")
}
id("com.ryandens.jlink-application") version "0.3.0"
}

repositories {
Expand All @@ -54,10 +33,27 @@ dependencies {
// implementation("org.eclipse.platform:org.eclipse.jface.databinding:1.15.100")
}

distributions {
main {
distributionBaseName = "qr-code-with-logo-app"
}
}

application {
mainClass = "io.github.simonscholz.MainKt"
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

jlinkJre {
// defaults to only java.base
modules.set(setOf("java.desktop"))
}

graalvmNative {
binaries {
named("main") {
Expand Down

0 comments on commit 849d21c

Please sign in to comment.