build: подпись release из keystore.properties
Нет файла - подпись остаётся через IDE. Креды вне git.
This commit is contained in:
1 parent
b3b826fe7d
commit
c78df5aae5
3 files changed
+29
No files matched your search
@@ -7,6 +7,11 @@
|
||||
.cxx
|
||||
local.properties
|
||||
|
||||
# Signing
|
||||
keystore.properties
|
||||
*.jks
|
||||
*.keystore
|
||||
|
||||
# Android Studio / IntelliJ
|
||||
.idea/
|
||||
*.iml
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
}
|
||||
|
||||
// Подпись release из keystore.properties (вне git). Нет файла - подпись через IDE.
|
||||
val keystorePropsFile = rootProject.file("keystore.properties")
|
||||
val keystoreProps = Properties().apply {
|
||||
if (keystorePropsFile.exists()) keystorePropsFile.inputStream().use { load(it) }
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.freeturn.app"
|
||||
compileSdk = 37
|
||||
@@ -35,8 +43,20 @@ android {
|
||||
compose = true
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (keystorePropsFile.exists()) {
|
||||
create("release") {
|
||||
storeFile = file(keystoreProps.getProperty("storeFile"))
|
||||
storePassword = keystoreProps.getProperty("storePassword")
|
||||
keyAlias = keystoreProps.getProperty("keyAlias")
|
||||
keyPassword = keystoreProps.getProperty("keyPassword")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig = signingConfigs.findByName("release")
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
storeFile=release.jks
|
||||
storePassword=
|
||||
keyAlias=
|
||||
keyPassword=
|
||||
Reference in new issue
Block a user