Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/imageviewer/desktopApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,9 @@ compose.desktop {
iconFile.set(iconsRoot.resolve("icon-linux.png"))
}
}

buildTypes.release.proguard {
configurationFiles.from(project.file("rules.pro"))
}
}
}
7 changes: 3 additions & 4 deletions examples/imageviewer/desktopApp/rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
-keep class io.ktor.** { *; }
-keepclassmembers class io.ktor.** { volatile <fields>; }
-keep class io.ktor.client.engine.cio.** { *; }
-keep class kotlinx.coroutines.** { *; }
-dontwarn kotlinx.atomicfu.**
-dontwarn io.netty.**
-dontwarn com.typesafe.**
-dontwarn org.slf4j.**

# Obfuscation breaks coroutines/ktor for some reason
-dontobfuscate
-dontnote io.ktor.**
-dontnote org.slf4j.**
-dontnote kotlinx.serialization.**
5 changes: 4 additions & 1 deletion examples/issues/desktop/compose-desktop.pro
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**

-keep class org.ocpsoft.prettytime.i18n**
-keep class org.ocpsoft.prettytime.i18n**

-dontnote okhttp3.**
-keep class okio.Okio__JvmOkioKt { *; }
4 changes: 4 additions & 0 deletions examples/nav_cupcake/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ compose.desktop {
packageName = "org.jetbrains.nav_cupcake"
packageVersion = "1.0.0"
}

buildTypes.release.proguard {
configurationFiles.from(project.file("rules.pro"))
}
}
}

Expand Down
1 change: 1 addition & 0 deletions examples/nav_cupcake/composeApp/rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-keep enum org.jetbrains.nav_cupcake.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.jetbrains.compose.internal.utils.notNullProperty
import org.jetbrains.compose.internal.utils.nullableProperty
import javax.inject.Inject

private const val DEFAULT_PROGUARD_VERSION = "7.2.2"
private const val DEFAULT_PROGUARD_VERSION = "7.7.0"

abstract class ProguardSettings @Inject constructor(
objects: ObjectFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
-dontwarn java.lang.ClassValue
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

# https://youtrack.jetbrains.com/issue/CMP-3818/Update-ProGuard-to-version-7.4-to-support-new-Java-versions
# https://youtrack.jetbrains.com/issue/CMP-7577/Desktop-runRelease-crash-when-upgrade-to-CMP-1.8.0-alpha02
-keep,allowshrinking,allowobfuscation class kotlinx.coroutines.flow.FlowKt { *; }
-keep,allowshrinking,allowobfuscation class kotlinx.coroutines.Job { *; }
-dontnote kotlinx.coroutines.**

# org.jetbrains.kotlinx:kotlinx-coroutines-swing
-keep class kotlinx.coroutines.swing.SwingDispatcherFactory

# Kotlinx Datetime
# Material3 depends on it, and it references `kotlinx.serialization`, which is optional
# Copied from https://github.com/Kotlin/kotlinx-datetime/blob/v0.6.2/core/jvm/resources/META-INF/proguard/datetime.pro
Expand Down Expand Up @@ -56,4 +65,6 @@
-dontwarn org.graalvm.compiler.core.aarch64.AArch64NodeMatchRules_MatchStatementSet*

# Androidx
-keep,allowshrinking,allowobfuscation class androidx.compose.runtime.SnapshotStateKt__DerivedStateKt { *; }
-keep class androidx.compose.material3.SliderDefaults { *; }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed in graphics-2d example

-dontnote androidx.**
Loading