Add fdroid flavor

This commit is contained in:
MM20 2023-01-23 15:02:00 +01:00
parent d2d153b18b
commit 014330ce71
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -1,4 +1,4 @@
import java.text.SimpleDateFormat
import android.annotation.SuppressLint
import java.util.*
plugins {
@ -25,7 +25,8 @@ android {
applicationId = "de.mm20.launcher2"
minSdk = sdk.versions.minSdk.get().toInt()
targetSdk = sdk.versions.targetSdk.get().toInt()
versionCode = versionCodeDate()
@SuppressLint("HighAppVersionCode")
versionCode = 2023012300
versionName = "1.21.0"
signingConfig = signingConfigs.getByName("debug")
}
@ -38,8 +39,6 @@ android {
isObfuscate = false
isOptimizeCode = true
}
versionNameSuffix = "-" + buildTime()
}
debug {
applicationIdSuffix = ".debug"
@ -47,6 +46,17 @@ android {
// This somehow seems to resolve that issue.
isDebuggable = false
}
flavorDimensions += "variant"
productFlavors {
create("default") {
dimension = "variant"
}
create("fdroid") {
dimension = "variant"
versionNameSuffix = "-fdroid"
}
}
}
configurations.all {
//Fixes Error: Duplicate class: com.google.common.util.concurrent.ListenableFuture
@ -68,16 +78,6 @@ android {
namespace = "de.mm20.launcher2"
}
fun buildTime(): String {
val df = SimpleDateFormat("yyyyMMdd")
return df.format(Date())
}
fun versionCodeDate(): Int {
val df = SimpleDateFormat("yyyyMMdd00")
return df.format(Date()).toInt()
}
dependencies {
implementation(libs.bundles.kotlin)