feat: App 应用内更新
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
import java.io.FileInputStream
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
}
|
||||
|
||||
val keystores: Map<String, Properties?> =
|
||||
mapOf("release" to loadKeystoreProperties("keystore.properties"))
|
||||
|
||||
android {
|
||||
namespace = "com.yuanxuan.rokid"
|
||||
compileSdk {
|
||||
@@ -19,8 +25,23 @@ android {
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
keystores["release"]?.let { proerties ->
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
storeFile = rootProject.file(proerties["storeFile"] as String)
|
||||
storePassword = proerties["storePassword"] as String
|
||||
keyAlias = proerties["keyAlias"] as String
|
||||
keyPassword = proerties["keyPassword"] as String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
@@ -59,4 +80,16 @@ dependencies {
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidx.junit)
|
||||
androidTestImplementation(libs.androidx.espresso.core)
|
||||
}
|
||||
|
||||
fun loadKeystoreProperties(filename: String): Properties? {
|
||||
val keystorePropertiesFile = file("${project.rootDir}/$filename")
|
||||
|
||||
return if (keystorePropertiesFile.exists()) {
|
||||
val keystoreProperties = Properties()
|
||||
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||
keystoreProperties
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user