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
|
|
@ -1,9 +1,16 @@
|
|||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
}
|
||||
|
||||
val keystorePropsFile = rootProject.file("keystore.properties")
|
||||
val keystoreProps = Properties().apply {
|
||||
if (keystorePropsFile.exists()) load(keystorePropsFile.inputStream())
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "net.jeena.pacer"
|
||||
compileSdk = 36
|
||||
|
|
@ -19,9 +26,21 @@ android {
|
|||
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 {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
isMinifyEnabled = true
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue