Skip to content

Commit

Permalink
build.gradle.kts: use the custom debug key if release key isn't avail…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
Ishan09811 authored Jan 8, 2025
1 parent d7edfdc commit 4cd53ac
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/pandroid/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,32 @@ android {
}
}

signingConfigs {
create("release") {
val keystoreAlias = System.getenv("KEYSTORE_ALIAS") ?: "androiddebugkey"
val keystorePassword = System.getenv("KEYSTORE_PASS") ?: "android"
val keystorePath = System.getenv("KEYSTORE_PATH") ?: "${project.rootDir}/debug.keystore"

keyAlias = keystoreAlias
keyPassword = keystorePassword
storeFile = file(keystorePath)
storePassword = keystorePassword
}

create("custom_debug") {
storeFile = file("${project.rootDir}/debug.keystore")
storePassword = "android"
keyAlias = "androiddebugkey"
keyPassword = "android"
}
}

buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
isDebuggable = false
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand All @@ -35,6 +55,7 @@ android {
isMinifyEnabled = false
isShrinkResources = false
isDebuggable = true
signingConfig = signingConfigs.getByName("custom_debug")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down

0 comments on commit 4cd53ac

Please sign in to comment.