Add release build configuration with automatic signing

- Configure release build type with minify and shrink resources
- Add signing configuration using keystore
- Use gradle.properties for secure password storage
- Add keystore to .gitignore for security
This commit is contained in:
2026-03-15 21:47:31 +08:00
parent ffb6677cfd
commit 4415f28d08
3 changed files with 19 additions and 1 deletions

View File

@@ -20,13 +20,24 @@ android {
}
}
signingConfigs {
create("release") {
storeFile = file(project.properties["RELEASE_STORE_FILE"] as String? ?: "my-release.jks")
storePassword = project.properties["RELEASE_STORE_PASSWORD"] as String? ?: "android123"
keyAlias = project.properties["RELEASE_KEY_ALIAS"] as String? ?: "my-key"
keyPassword = project.properties["RELEASE_KEY_PASSWORD"] as String? ?: "android123"
}
}
buildTypes {
release {
isMinifyEnabled = false
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("release")
}
}
compileOptions {