diff --git a/app/desktop/build.gradle.kts b/app/desktop/build.gradle.kts index 4472c32..a625092 100644 --- a/app/desktop/build.gradle.kts +++ b/app/desktop/build.gradle.kts @@ -240,6 +240,18 @@ fun stageWindowsJpackageRuntime(appImageRoot: File) { /** Desktop compile target — must stay in sync with `kotlin { jvmToolchain(desktopJvmTarget) }`. */ private val desktopJvmTarget = 25 +/** + * ProGuard version used by the Compose release tasks. + * + * The Compose plugin defaults to 7.8.0, which cannot process the Java 25 class files + * produced by `jvmToolchain(desktopJvmTarget)` — ProGuard then fails to load the JDK + * itself and reports `can't find referenced class java.lang.Class` / + * `the configuration refers to the unknown class 'java.lang.String'`. + * 7.9.0 added Java 25 support; 7.10.0 is the first release that also understands the + * Kotlin 2.4 metadata this project compiles against. + */ +private val proguardVersion = "7.10.0" + fun resolvePackagingJdkHome(): String { // The desktop module compiles to jvmToolchain(desktopJvmTarget) classes; jpackage must // bundle a runtime >= that or the installed app dies at launch with @@ -378,6 +390,7 @@ compose.desktop { javaHome = resolvePackagingJdkHome() buildTypes.release.proguard { + version = proguardVersion configurationFiles.from(project.file("proguard-rules.pro")) } diff --git a/app/desktop/proguard-rules.pro b/app/desktop/proguard-rules.pro index ba4dc04..c1c5911 100644 --- a/app/desktop/proguard-rules.pro +++ b/app/desktop/proguard-rules.pro @@ -39,3 +39,11 @@ ; (...); } + +# JetBrains Runtime bundles a `jogl.all.jmod` (JOGL, incl. its JavaFX bridge) in its jmods +# directory, which ProGuard picks up as a library jar. Those JOGL classes extend JavaFX +# classes that are ProGuard *program* inputs, so ProGuard reports 7x +# "library class com.jogamp.newt.javafx.* extends or implements program class javafx.*" +# and then aborts with "Please correct the above warnings first". The app never uses JOGL, +# so only that JavaFX bridge is ignored (JDKs without the jmod, e.g. Temurin, are unaffected). +-dontwarn com.jogamp.newt.javafx.**