100 lines
3.1 KiB
Kotlin
100 lines
3.1 KiB
Kotlin
import java.util.Properties
|
|
|
|
plugins {
|
|
alias(libs.plugins.android.application)
|
|
alias(libs.plugins.kotlin.compose)
|
|
}
|
|
|
|
|
|
android {
|
|
namespace = "com.lzxnone.openloc"
|
|
compileSdk {
|
|
version = release(36) {
|
|
minorApiLevel = 1
|
|
}
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId = "com.lzxnone.openloc"
|
|
minSdk = 28
|
|
targetSdk = 36
|
|
versionCode = 2
|
|
versionName = "1.1.0"
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
splits {
|
|
abi {
|
|
isEnable = true
|
|
reset()
|
|
include("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
|
isUniversalApk = true
|
|
}
|
|
}
|
|
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
val keystorePropsFile = rootProject.file("keystore.properties")
|
|
if (keystorePropsFile.exists()) {
|
|
val props = Properties()
|
|
keystorePropsFile.inputStream().use { stream ->
|
|
props.load(stream)
|
|
}
|
|
storeFile = file(props.getProperty("storeFile", "openloc.jks"))
|
|
storePassword = props.getProperty("storePassword")
|
|
keyAlias = props.getProperty("keyAlias")
|
|
keyPassword = props.getProperty("keyPassword")
|
|
} else {
|
|
// CI/CD 或未配置密钥时平滑降级,确保构建永远不抛错中断
|
|
val debugConfig = getByName("debug")
|
|
storeFile = debugConfig.storeFile
|
|
storePassword = debugConfig.storePassword
|
|
keyAlias = debugConfig.keyAlias
|
|
keyPassword = debugConfig.keyPassword
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = false
|
|
signingConfig = signingConfigs.getByName("release")
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
buildFeatures {
|
|
compose = true
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(platform(libs.androidx.compose.bom))
|
|
implementation(libs.androidx.activity.compose)
|
|
implementation(libs.androidx.compose.material3)
|
|
implementation(libs.androidx.compose.material.icons.extended)
|
|
implementation(libs.androidx.compose.ui)
|
|
implementation(libs.androidx.compose.ui.graphics)
|
|
implementation(libs.androidx.compose.ui.tooling.preview)
|
|
implementation(libs.androidx.core.ktx)
|
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
|
implementation(libs.osmdroid.android)
|
|
compileOnly(libs.xposed.api)
|
|
testImplementation(libs.junit)
|
|
androidTestImplementation(platform(libs.androidx.compose.bom))
|
|
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
|
|
androidTestImplementation(libs.androidx.espresso.core)
|
|
androidTestImplementation(libs.androidx.junit)
|
|
debugImplementation(libs.androidx.compose.ui.test.manifest)
|
|
debugImplementation(libs.androidx.compose.ui.tooling)
|
|
} |