Skip to content

Commit

Permalink
chore: remove additional Kotlin assertions thanks to new Proguard rules
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeyls committed May 28, 2024
1 parent 624941c commit c70a681
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
9 changes: 1 addition & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ android {
isShrinkResources = true
proguardFiles("proguard-defaults.txt", "proguard-rules.pro")

kotlinOptions {
freeCompilerArgs = listOf(
"-Xno-param-assertions",
"-Xno-call-assertions",
"-Xno-receiver-assertions"
)
}

packaging {
resources {
excludes += listOf(
Expand All @@ -55,6 +47,7 @@ android {
jniLibs {
excludes += "**/libdatastore_shared_counter.so"
}
vcsInfo.include = false
}
}
}
Expand Down
19 changes: 18 additions & 1 deletion app/proguard-defaults.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,21 @@
-dontwarn android.util.FloatMath

# These classes are duplicated between android.jar and core-lambda-stubs.jar.
-dontnote java.lang.invoke.**
-dontnote java.lang.invoke.**

# Remove Kotlin assertions
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
public static void checkNotNull(...);
public static void checkExpressionValueIsNotNull(...);
public static void checkNotNullExpressionValue(...);
public static void checkParameterIsNotNull(...);
public static void checkNotNullParameter(...);
public static void checkReturnedValueIsNotNull(...);
public static void checkFieldIsNotNull(...);
public static void throwUninitializedPropertyAccessException(...);
public static void throwNpe(...);
public static void throwJavaNpe(...);
public static void throwAssert(...);
public static void throwIllegalArgument(...);
public static void throwIllegalState(...);
}

0 comments on commit c70a681

Please sign in to comment.