From d389bd35bb7c24cf8f05aea496544e9d0764fc7a Mon Sep 17 00:00:00 2001 From: Ellet Date: Sat, 8 Jun 2024 09:47:01 +0300 Subject: [PATCH] feat: add an option to minimize kotlin standard library in AbstractProguardTask --- .../desktop/application/tasks/AbstractProguardTask.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractProguardTask.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractProguardTask.kt index fa04502a91..bb5cffafcb 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractProguardTask.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractProguardTask.kt @@ -42,6 +42,10 @@ abstract class AbstractProguardTask : AbstractComposeDesktopTask() { @get:Input val dontoptimize: Property = objects.nullableProperty() + @get:Optional + @get:Input + val minimizeKotlinStandardLibrary: Property = objects.nullableProperty() + @get:Optional @get:Input val joinOutputJars: Property = objects.nullableProperty() @@ -125,6 +129,10 @@ abstract class AbstractProguardTask : AbstractComposeDesktopTask() { writer.writeLn("-dontoptimize") } + if (minimizeKotlinStandardLibrary.orNull == false) { + writer.writeLn("-keep class kotlin.** { *; }") + } + writer.writeLn(""" -keep public class ${mainClass.get()} { public static void main(java.lang.String[]);