Skip to content

Commit

Permalink
Tweak release signing config
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Sep 16, 2024
1 parent e8b1190 commit 7dc2356
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import app.cash.licensee.LicenseeTask
import com.android.build.gradle.internal.api.ApkVariantOutputImpl
import com.android.build.gradle.tasks.MergeResources
import java.io.FileInputStream
import java.util.Locale
import java.util.Properties

Expand Down Expand Up @@ -42,24 +41,23 @@ android {
vectorDrawables.useSupportLibrary = true
}

val keystorePropertiesFile = rootProject.file("keystore.properties")
val releaseSigning = if (keystorePropertiesFile.exists()) {
androidResources {
generateLocaleConfig = true
}

val releaseSigning = try {
val keystoreProperties = Properties()
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
keystoreProperties.load(rootProject.file("keystore.properties").inputStream())
signingConfigs.create("release") {
keyAlias = keystoreProperties["keyAlias"].toString()
keyPassword = keystoreProperties["keyPassword"].toString()
storeFile = rootProject.file(keystoreProperties["storeFile"].toString())
storePassword = keystoreProperties["storePassword"].toString()
}
} else {
} catch (ignored: Exception) {
signingConfigs["debug"]
}

androidResources {
generateLocaleConfig = true
}

buildTypes {
all {
signingConfig = releaseSigning
Expand Down

0 comments on commit 7dc2356

Please sign in to comment.