From 014330ce71b72250df580b878cb6c5095c01cb20 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Mon, 23 Jan 2023 15:02:00 +0100 Subject: [PATCH] Add fdroid flavor --- app/app/build.gradle.kts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/app/build.gradle.kts b/app/app/build.gradle.kts index 0e4a1b24..36e61f54 100644 --- a/app/app/build.gradle.kts +++ b/app/app/build.gradle.kts @@ -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)