[优化] 编译脚本
This commit is contained in:
5 files changed
+21
-45
No files matched your search
+17
-33
@@ -4,7 +4,6 @@ import java.util.Properties
|
||||
plugins {
|
||||
alias(libs.plugins.compose.compiler)
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
alias(libs.plugins.kotlin.parcelize)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
alias(libs.plugins.room)
|
||||
@@ -32,12 +31,6 @@ android {
|
||||
compileSdk = 37
|
||||
namespace = "io.legado.app"
|
||||
|
||||
kotlin {
|
||||
jvmToolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(21))
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
create("myConfig") {
|
||||
@@ -139,31 +132,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
applicationVariants.all {
|
||||
val variant = this
|
||||
outputs.all {
|
||||
val output = this as com.android.build.gradle.internal.api.BaseVariantOutputImpl
|
||||
val abi = output.getFilter(com.android.build.OutputFile.ABI)
|
||||
val flavor = variant.productFlavors[0].name
|
||||
val baseVersionName = variant.versionName
|
||||
var apkName = "${appName}_${flavor}_${baseVersionName}"
|
||||
if (abi != null) {
|
||||
apkName += "_$abi"
|
||||
}
|
||||
output.outputFileName = "$apkName.apk"
|
||||
}
|
||||
}
|
||||
|
||||
room {
|
||||
schemaDirectory("$projectDir/schemas")
|
||||
}
|
||||
|
||||
ksp {
|
||||
arg("room.incremental", "true")
|
||||
arg("room.expandProjection", "true")
|
||||
arg("room.generateKotlin", "false")
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
@@ -175,7 +143,7 @@ android {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
getByName("androidTest").assets.srcDirs("$projectDir/schemas")
|
||||
getByName("androidTest").assets.directories.add("$projectDir/schemas")
|
||||
}
|
||||
|
||||
lint {
|
||||
@@ -183,6 +151,22 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(21))
|
||||
}
|
||||
}
|
||||
|
||||
room {
|
||||
schemaDirectory("$projectDir/schemas")
|
||||
}
|
||||
|
||||
ksp {
|
||||
arg("room.incremental", "true")
|
||||
arg("room.expandProjection", "true")
|
||||
arg("room.generateKotlin", "false")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring(libs.desugar)
|
||||
testImplementation(libs.junit)
|
||||
|
||||
Reference in new issue
Block a user