Skip to content

Commit

Permalink
Merge pull request #80 from Semper-Viventem/configure-fdroid-build
Browse files Browse the repository at this point in the history
Configure fdroid build
  • Loading branch information
Semper-Viventem authored Dec 31, 2023
2 parents 9316e61 + 3984bef commit b7c2021
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {
minSdk = 29
targetSdk = 34
versionCode = (System.currentTimeMillis() / 1000).toInt()
versionName = "0.21.1-beta"
versionName = "0.21.2-beta"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -38,6 +38,8 @@ android {
val DEBUG = "debug"
val RELEASE = "release"

val NO_SIGNING_CONFIG = "no_signing_store"

signingConfigs {
maybeCreate(DEBUG).apply {
storeFile = file("../signing/debug-keystore.jks")
Expand Down Expand Up @@ -65,7 +67,10 @@ android {
isMinifyEnabled = true
isShrinkResources = true
isDebuggable = false
signingConfig = signingConfigs[RELEASE]

val hasSignConfig = gradleLocalProperties(rootDir).getProperty("releaseStoreFile", System.getenv("RELEASE_STORE_PATH") ?: NO_SIGNING_CONFIG) != NO_SIGNING_CONFIG

signingConfig = if (hasSignConfig) signingConfigs[RELEASE] else null
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
Expand All @@ -74,11 +79,19 @@ android {
productFlavors {
create("googlePlay") {
dimension = "distribution"
isDefault = false

buildConfigField("String", "DISTRIBUTION", "\"Google play\"")
}
create("fdroid") {
dimension = "distribution"
isDefault = false

buildConfigField("String", "DISTRIBUTION", "\"F-Droid\"")
}
create("github") {
dimension = "distribution"
isDefault = true

buildConfigField("String", "DISTRIBUTION", "\"Github\"")
}
Expand Down

0 comments on commit b7c2021

Please sign in to comment.