Mark Alvaro
01/25/2023, 5:12 PMUnable to find method ''void org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions.setUseIR(boolean)''
'void org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions.setUseIR(boolean)'
Does anyone know how to just disable ProGuard? Most stackoverflow posts unfortunately don't cover it with modern build.gradle.kts syntax.compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "myapp"
packageVersion = "1.0.0"
}
buildTypes.release.proguard {
configurationFiles.from("<http://rules.pro|rules.pro>")
}
}
}
with a rules.pro file at the root level of my project (same directory as build.gradle.kts) with the following contents:
-keepclassmembernames class io.netty.** { *; }
-keepclassmembers class org.jctools.** { *; }
Where I was trying to follow the directions on the JetBrains Blog using the suggestions from this post for configuration. But ultimately it’s still failing at runtime as it can’t find the class or do some logic in that class’s initialization block.isEnabled.set(false)
in the proguard block above, but that doesn’t seem to do it either.Dima Avdeev
01/25/2023, 7:21 PMMark Alvaro
01/26/2023, 1:27 PMalexey.tsvetkov
01/26/2023, 1:38 PMcreateReleaseDistributable
is the “release” version of createDistributable
), then ProGuard does not run. This is documented https://github.com/JetBrains/compose-jb/tree/master/tutorials/Native_distributions_and_local_execution#minification--obfuscation
2. Even before ProGuard support we had support, which minifies JDK image through jlink
. This only applies to the JDK standard library. It was enabled by default to improve the default image size out-of-the-box (which was probably not the best decision). However, at the time we did not find the way to reliable automate selection of modules, so a set of included modules is either has to be adjusted manually or all modules should be included. This part is documented https://github.com/JetBrains/compose-jb/tree/master/tutorials/Native_distributions_and_local_execution#configuring-included-jdk-modulesMark Alvaro
01/26/2023, 1:47 PMalexey.tsvetkov
01/26/2023, 1:52 PMMark Alvaro
01/26/2023, 1:53 PM