2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 01:51:47 +00:00

feat: allow disable minify when build debug package

This commit is contained in:
ShellWen Chen 2024-04-01 16:35:16 +00:00 committed by Albert Vaca Cintora
parent 91867481a8
commit 29c4fe3f8d

View File

@ -1,6 +1,8 @@
import com.github.jk1.license.LicenseReportExtension
import com.github.jk1.license.render.ReportRenderer
import com.github.jk1.license.render.TextReportRenderer
import java.io.FileNotFoundException
import java.util.Properties
buildscript {
dependencies {
@ -97,8 +99,18 @@ android {
}
buildTypes {
getByName("debug") {
isMinifyEnabled = true
isShrinkResources = true
// We minify by default even on debug builds. This has helped us catch issues where minification would remove files that were actually used (eg: via reflection).
// If you want to locally disable this behavior to speed-up the build, add a line `disableMinifyDebug=true` to your `local.properties` file.
val reader = try {
rootProject.file("local.properties").reader()
} catch (e: FileNotFoundException) {
null
}
val properties = reader?.use { Properties().apply { load(it) } }
val disableMinifyDebug = properties?.getProperty("disableMinifyDebug")?.toBoolean() ?: false
isMinifyEnabled = !disableMinifyDebug
isShrinkResources = !disableMinifyDebug
signingConfig = signingConfigs.getByName("debug")
}
// keep minifyEnabled false above for faster builds; set to 'true'