Skip to content

Commit

Permalink
chore: Enable Shrinking for TestApp when Build with "minify" Property
Browse files Browse the repository at this point in the history
To easily locate shrinking issues (e.g. missing Proguard Consumer rules)
I enabled shrinking for the TestApp when it is build with the optional
parameter "minify".
  • Loading branch information
wba2hi committed Sep 18, 2023
1 parent b924b50 commit 3d82ab3
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@ android {
}
}
buildTypes {
debug { isMinifyEnabled = false }
release {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
// for local builds, used to find shrinking issues
val isMinify = project.hasProperty("minify")
if (isMinify) {
debug {
// while isDebuggable is set to true no obfuscation takes place,
// the shrinking phase will still remove unused classes
isDebuggable = true

isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
}
namespace = "org.eclipse.kuksa.testapp"
Expand Down Expand Up @@ -96,3 +103,10 @@ dependencies {

implementation(libs.androidx.activity.compose)
}

tasks.register("testTask") {
val hasProperty = project.hasProperty("minify")
doLast {
println("minify: $hasProperty")
}
}

0 comments on commit 3d82ab3

Please sign in to comment.