2026-04-21 22:07:29 +08:00
|
|
|
plugins {
|
|
|
|
|
alias(libs.plugins.android.application)
|
|
|
|
|
alias(libs.plugins.kotlin.compose)
|
2026-07-27 09:46:13 +08:00
|
|
|
id("com.xuqm.common")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val releaseSigningProperties = mapOf(
|
|
|
|
|
"storeFile" to providers.gradleProperty("YIWANGXIN_STORE_FILE"),
|
|
|
|
|
"storePassword" to providers.gradleProperty("YIWANGXIN_STORE_PASSWORD"),
|
|
|
|
|
"keyAlias" to providers.gradleProperty("YIWANGXIN_ALIAS"),
|
|
|
|
|
"keyPassword" to providers.gradleProperty("YIWANGXIN_KEY_PASSWORD"),
|
|
|
|
|
)
|
|
|
|
|
val hasReleaseSigning = releaseSigningProperties.values.all {
|
|
|
|
|
it.orNull?.isNotBlank() == true
|
2026-04-21 22:07:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
android {
|
|
|
|
|
namespace = "com.xuqm.sdk.sample"
|
|
|
|
|
compileSdk = libs.versions.compileSdk.get().toInt()
|
|
|
|
|
|
|
|
|
|
defaultConfig {
|
2026-05-05 21:40:50 +08:00
|
|
|
applicationId = "cn.org.bjca.wcert.ywq"
|
2026-04-21 22:07:29 +08:00
|
|
|
minSdk = libs.versions.minSdk.get().toInt()
|
|
|
|
|
targetSdk = libs.versions.targetSdk.get().toInt()
|
|
|
|
|
versionCode = 1
|
|
|
|
|
versionName = "1.0.0"
|
2026-05-05 16:06:32 +08:00
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
2026-04-21 22:07:29 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-05 21:40:50 +08:00
|
|
|
signingConfigs {
|
2026-07-27 09:46:13 +08:00
|
|
|
if (hasReleaseSigning) {
|
|
|
|
|
create("releaseFromProperties") {
|
|
|
|
|
storeFile = file(releaseSigningProperties.getValue("storeFile").get())
|
|
|
|
|
storePassword = releaseSigningProperties.getValue("storePassword").get()
|
|
|
|
|
keyAlias = releaseSigningProperties.getValue("keyAlias").get()
|
|
|
|
|
keyPassword = releaseSigningProperties.getValue("keyPassword").get()
|
|
|
|
|
}
|
2026-05-05 21:40:50 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-21 22:07:29 +08:00
|
|
|
buildTypes {
|
|
|
|
|
release {
|
|
|
|
|
isMinifyEnabled = false
|
2026-07-27 09:46:13 +08:00
|
|
|
signingConfig = signingConfigs.findByName("releaseFromProperties")
|
2026-04-21 22:07:29 +08:00
|
|
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
compileOptions {
|
2026-07-27 09:46:13 +08:00
|
|
|
isCoreLibraryDesugaringEnabled = true
|
2026-04-27 19:00:54 +08:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
|
|
|
targetCompatibility = JavaVersion.VERSION_11
|
2026-04-27 17:18:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buildFeatures {
|
|
|
|
|
compose = true
|
|
|
|
|
buildConfig = true
|
2026-04-21 22:07:29 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-27 09:46:13 +08:00
|
|
|
val validateSampleReleaseSigning by tasks.registering {
|
|
|
|
|
group = "verification"
|
|
|
|
|
description = "校验 Sample Release 签名属性存在且密钥库文件可读。"
|
|
|
|
|
doLast {
|
|
|
|
|
val missing = releaseSigningProperties
|
|
|
|
|
.filterValues { it.orNull.isNullOrBlank() }
|
|
|
|
|
.keys
|
|
|
|
|
check(missing.isEmpty()) {
|
|
|
|
|
"Sample Release signing properties are missing: " +
|
|
|
|
|
missing.joinToString { key ->
|
|
|
|
|
when (key) {
|
|
|
|
|
"storeFile" -> "YIWANGXIN_STORE_FILE"
|
|
|
|
|
"storePassword" -> "YIWANGXIN_STORE_PASSWORD"
|
|
|
|
|
"keyAlias" -> "YIWANGXIN_ALIAS"
|
|
|
|
|
else -> "YIWANGXIN_KEY_PASSWORD"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
check(file(releaseSigningProperties.getValue("storeFile").get()).isFile) {
|
|
|
|
|
"YIWANGXIN_STORE_FILE does not reference a readable file"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasks.matching { it.name == "preReleaseBuild" }.configureEach {
|
|
|
|
|
dependsOn(validateSampleReleaseSigning)
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-21 22:07:29 +08:00
|
|
|
dependencies {
|
2026-07-27 09:46:13 +08:00
|
|
|
coreLibraryDesugaring(libs.desugar.jdk.libs)
|
2026-04-21 22:07:29 +08:00
|
|
|
implementation(project(":sdk-core"))
|
2026-07-27 09:46:13 +08:00
|
|
|
implementation(project(":sdk-bugcollect"))
|
2026-04-21 22:07:29 +08:00
|
|
|
implementation(project(":sdk-im"))
|
|
|
|
|
implementation(project(":sdk-push"))
|
|
|
|
|
implementation(project(":sdk-update"))
|
2026-05-07 19:39:38 +08:00
|
|
|
implementation(project(":sdk-webview"))
|
2026-04-27 17:18:55 +08:00
|
|
|
|
2026-04-21 22:07:29 +08:00
|
|
|
implementation(platform(libs.androidx.compose.bom))
|
|
|
|
|
implementation(libs.bundles.compose)
|
|
|
|
|
implementation(libs.androidx.activity.compose)
|
2026-04-27 17:18:55 +08:00
|
|
|
implementation(libs.androidx.lifecycle.runtime.compose)
|
|
|
|
|
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
2026-04-27 19:00:54 +08:00
|
|
|
implementation(libs.google.material)
|
2026-04-27 17:18:55 +08:00
|
|
|
|
|
|
|
|
implementation(libs.androidx.navigation.compose)
|
|
|
|
|
|
|
|
|
|
implementation(libs.coil.compose)
|
|
|
|
|
implementation(libs.coil.network.okhttp)
|
|
|
|
|
|
2026-04-21 22:07:29 +08:00
|
|
|
debugImplementation(libs.bundles.compose.debug)
|
2026-05-05 16:06:32 +08:00
|
|
|
|
|
|
|
|
androidTestImplementation(libs.androidx.junit)
|
|
|
|
|
androidTestImplementation(libs.androidx.espresso.core)
|
2026-04-21 22:07:29 +08:00
|
|
|
}
|