mirror of
https://codeberg.org/mi6e4ka/openstore.git
synced 2026-07-10 00:12:06 +00:00
add support building signed release artifact with keystore.properties
This commit is contained in:
parent
fc003a8f8b
commit
f65340b09c
2 changed files with 24 additions and 0 deletions
|
|
@ -1,9 +1,17 @@
|
|||
import java.util.Properties
|
||||
import java.io.FileInputStream
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
}
|
||||
|
||||
val keystoreProperties = Properties()
|
||||
val keystoreFileExists = rootProject.file("keystore.properties").exists();
|
||||
if (keystoreFileExists) {
|
||||
keystoreProperties.load(rootProject.file("keystore.properties").inputStream())
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "dev.mi6e4ka.openstore"
|
||||
compileSdk = 36
|
||||
|
|
@ -21,10 +29,22 @@ android {
|
|||
//testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (keystoreFileExists) {
|
||||
create("release") {
|
||||
storeFile = keystoreProperties["storeFile"]?.let { file(it as String) }
|
||||
storePassword = keystoreProperties["storePassword"] as String
|
||||
keyAlias = keystoreProperties["keyAlias"] as String
|
||||
keyPassword = keystoreProperties["keyPassword"] as String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
signingConfig = signingConfigs.findByName("release")?.takeIf { it.storeFile != null }
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
|
|
|
|||
4
keystore.properties.example
Normal file
4
keystore.properties.example
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
storeFile=/full/path/to/your.jks
|
||||
keyAlias=YourKeyAlias
|
||||
storePassword=yourStorePasswd
|
||||
keyPassword=yourKeyPasswd
|
||||
Loading…
Add table
Add a link
Reference in a new issue