Skip to content

Commit

Permalink
Updating play store release with proper credentials/keystore config
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuppan committed Mar 24, 2024
1 parent bdf2b90 commit 97cb436
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 81 deletions.
33 changes: 32 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import java.io.FileInputStream
import java.util.Properties

plugins {
id("naveenapps.plugin.android.app")
id("naveenapps.plugin.kotlin.basic")
Expand All @@ -11,6 +14,30 @@ plugins {
id("jacoco")
}

val credentialFilePath = "${rootDir.absolutePath}/keys/credentials.properties"
println(credentialFilePath)
val credentials = File(credentialFilePath)
if (credentials.exists()) {
println("----- Credentials available -----")
val properties = Properties().apply {
load(FileInputStream(credentials))
}

android {
signingConfigs {
create("release") {
keyAlias = properties.getProperty("KEY_ALIAS")
storePassword = properties.getProperty("KEY_STORE_PASSWORD")
keyPassword = properties.getProperty("KEY_PASSWORD")
storeFile = File("${rootDir.absolutePath}/keys/android_keystore.jks")
println("Credentials release created")
}
}
}
} else {
println("----- Credentials not available -----")
}

android {

namespace = "com.naveenapps.expensemanager"
Expand Down Expand Up @@ -38,7 +65,11 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("debug")

val keyStore = runCatching { signingConfigs.getByName("release") }.getOrNull() ?:
signingConfigs.getByName("debug")

signingConfig = keyStore
}
}

Expand Down

This file was deleted.

0 comments on commit 97cb436

Please sign in to comment.