diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1f327942..e92268c9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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" diff --git a/kuksa-sdk/build.gradle.kts b/kuksa-sdk/build.gradle.kts index d838e3d8..2b5d0b87 100644 --- a/kuksa-sdk/build.gradle.kts +++ b/kuksa-sdk/build.gradle.kts @@ -19,15 +19,6 @@ android { consumerProguardFiles("consumer-rules.pro") } - buildTypes { - release { - isMinifyEnabled = true - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro", - ) - } - } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 diff --git a/kuksa-sdk/consumer-rules.pro b/kuksa-sdk/consumer-rules.pro index 4a2ef0d2..e69de29b 100644 --- a/kuksa-sdk/consumer-rules.pro +++ b/kuksa-sdk/consumer-rules.pro @@ -1,6 +0,0 @@ --keep,allowobfuscation,allowoptimization,allowshrinking class org.eclipse.kuksa.DataBrokerConnection { *; } --keep,allowobfuscation,allowoptimization,allowshrinking class org.eclipse.kuksa.DataBrokerConnector { *; } --keep,allowobfuscation,allowoptimization,allowshrinking class org.eclipse.kuksa.model.Property { *; } --keep,allowobfuscation,allowoptimization,allowshrinking interface org.eclipse.kuksa.PropertyObserver { *; } --keep,allowobfuscation,allowoptimization,allowshrinking class org.eclipse.kuksa.CoroutineCallback { *; } --keep,allowobfuscation,allowoptimization,allowshrinking class org.eclipse.kuksa.TimeoutConfig { *; } diff --git a/kuksa-sdk/proguard-rules.pro b/kuksa-sdk/proguard-rules.pro deleted file mode 100644 index 6dfa2cd0..00000000 --- a/kuksa-sdk/proguard-rules.pro +++ /dev/null @@ -1,46 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile - --dontwarn java.lang.invoke.StringConcatFactory - -# don't shrink/remove classes; even if unused -# don't shrink/remove public methods and fields; even if unused -# don't rename class and public/protected methods / field names -# but rename private methods and fields --keep class org.eclipse.kuksa.DataBrokerConnection { - public protected *; -} - --keep class org.eclipse.kuksa.DataBrokerConnector { - public protected *; -} - --keep class com.etas.kuksa.sdk.model.** { - public protected *; -} - --keep class org.eclipse.kuksa.TimeoutConfig { *; } --keep interface org.eclipse.kuksa.DataBrokerException { *; } --keep interface org.eclipse.kuksa.PropertyObserver { *; } - -# used for java compatibility --keep class org.eclipse.kuksa.CoroutineCallback { *; } diff --git a/samples/build.gradle.kts b/samples/build.gradle.kts index 5c6767f3..fbd3a382 100644 --- a/samples/build.gradle.kts +++ b/samples/build.gradle.kts @@ -15,15 +15,6 @@ android { } } - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro", - ) - } - } compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 diff --git a/samples/proguard-rules.pro b/samples/proguard-rules.pro deleted file mode 100644 index 481bb434..00000000 --- a/samples/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file