feat(US-16): configure release signing and minification
Signing config reads from keystore.properties (gitignored). Release build has minification enabled. The keystore and properties file are excluded from version control. To build a signed release APK: ./gradlew assembleRelease Output: app/build/outputs/apk/release/app-release.apk
This commit is contained in:
parent
4647853ce7
commit
22fc569874
2 changed files with 25 additions and 1 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -12,3 +12,8 @@ local.properties
|
||||||
|
|
||||||
# Claude Code session data
|
# Claude Code session data
|
||||||
.claude/
|
.claude/
|
||||||
|
|
||||||
|
# Signing credentials — keep off version control
|
||||||
|
*.jks
|
||||||
|
*.keystore
|
||||||
|
keystore.properties
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,16 @@
|
||||||
|
import java.util.Properties
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.android.application)
|
alias(libs.plugins.android.application)
|
||||||
alias(libs.plugins.kotlin.android)
|
alias(libs.plugins.kotlin.android)
|
||||||
alias(libs.plugins.kotlin.compose)
|
alias(libs.plugins.kotlin.compose)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val keystorePropsFile = rootProject.file("keystore.properties")
|
||||||
|
val keystoreProps = Properties().apply {
|
||||||
|
if (keystorePropsFile.exists()) load(keystorePropsFile.inputStream())
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "net.jeena.pacer"
|
namespace = "net.jeena.pacer"
|
||||||
compileSdk = 36
|
compileSdk = 36
|
||||||
|
|
@ -19,9 +26,21 @@ android {
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
create("release") {
|
||||||
|
if (keystorePropsFile.exists()) {
|
||||||
|
storeFile = file(keystoreProps["storeFile"] as String)
|
||||||
|
storePassword = keystoreProps["storePassword"] as String
|
||||||
|
keyAlias = keystoreProps["keyAlias"] as String
|
||||||
|
keyPassword = keystoreProps["keyPassword"] as String
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
isMinifyEnabled = false
|
isMinifyEnabled = true
|
||||||
|
signingConfig = signingConfigs.getByName("release")
|
||||||
proguardFiles(
|
proguardFiles(
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
"proguard-rules.pro"
|
"proguard-rules.pro"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue