Build : signature release via keystore local (keystore.properties non versionné)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
ccc8fc3933
commit
d065c19972
3 changed files with 33 additions and 0 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -14,3 +14,7 @@
|
|||
.cxx
|
||||
local.properties
|
||||
.kotlin
|
||||
|
||||
# Signature release (ne jamais committer)
|
||||
release-key.jks
|
||||
keystore.properties
|
||||
|
|
|
|||
|
|
@ -1,8 +1,18 @@
|
|||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
}
|
||||
|
||||
// Signature release : lue depuis keystore.properties (non versionné)
|
||||
val keystorePropertiesFile = rootProject.file("keystore.properties")
|
||||
val keystoreProperties = Properties().apply {
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystorePropertiesFile.inputStream().use { load(it) }
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.maposition"
|
||||
compileSdk {
|
||||
|
|
@ -19,6 +29,17 @@ android {
|
|||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
storeFile = file(keystoreProperties["storeFile"] as String)
|
||||
storePassword = keystoreProperties["storePassword"] as String
|
||||
keyAlias = keystoreProperties["keyAlias"] as String
|
||||
keyPassword = keystoreProperties["keyPassword"] as String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
|
|
@ -26,6 +47,9 @@ android {
|
|||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
|
|
|
|||
5
keystore.properties.example
Normal file
5
keystore.properties.example
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# Copier ce fichier en keystore.properties (non versionné) et remplir :
|
||||
storeFile=../release-key.jks
|
||||
storePassword=CHANGEZ_MOI
|
||||
keyAlias=maposition
|
||||
keyPassword=CHANGEZ_MOI
|
||||
Loading…
Reference in a new issue