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:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@ NUL
|
||||
# Android/ Gradle build outputs (optional for CI, can be kept locally if desired)
|
||||
**/build/
|
||||
.gradle/
|
||||
app/my-release.jks
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -3,3 +3,9 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
android.useAndroidX=true
|
||||
kotlin.code.style=official
|
||||
android.nonTransitiveRClass=true
|
||||
|
||||
# Signing configuration
|
||||
RELEASE_STORE_PASSWORD=android123
|
||||
RELEASE_KEY_PASSWORD=android123
|
||||
RELEASE_KEY_ALIAS=my-key
|
||||
RELEASE_STORE_FILE=my-release.jks
|
||||
|
||||
Reference in New Issue
Block a user