[优化] 编译脚本
This commit is contained in:
+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)
|
||||
|
||||
+1
-2
@@ -9,7 +9,6 @@ plugins {
|
||||
alias(libs.plugins.compose.compiler) apply false
|
||||
alias(libs.plugins.android.application) apply false
|
||||
alias(libs.plugins.android.library) apply false
|
||||
alias(libs.plugins.kotlin.android) apply false
|
||||
alias(libs.plugins.kotlin.parcelize) apply false
|
||||
alias(libs.plugins.kotlin.serialization) apply false
|
||||
alias(libs.plugins.ksp) apply false
|
||||
@@ -20,4 +19,4 @@ plugins {
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -41,14 +41,9 @@ CronetMainVersion=128.0.0.0
|
||||
android.injected.testOnly=false
|
||||
android.nonFinalResIds=true
|
||||
android.injected.androidTest.leaveApksInstalledAfterRun=true
|
||||
android.sdk.defaultTargetSdkToCompileSdkIfUnset=false
|
||||
android.enableAppCompileTimeRClass=false
|
||||
android.usesSdkInManifest.disallowed=false
|
||||
android.uniquePackageNames=false
|
||||
android.dependency.useConstraints=true
|
||||
android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false
|
||||
android.r8.strictFullModeForKeepRules=false
|
||||
android.r8.optimizedResourceShrinking=false
|
||||
android.builtInKotlin=false
|
||||
android.newDsl=false
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
}
|
||||
|
||||
android {
|
||||
@@ -23,10 +22,10 @@ android {
|
||||
}
|
||||
lint {
|
||||
checkDependencies = true
|
||||
targetSdk = 36
|
||||
targetSdk = 37
|
||||
}
|
||||
testOptions {
|
||||
targetSdk = 36
|
||||
targetSdk = 37
|
||||
}
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.compilerArgs.add("-Xlint:deprecation")
|
||||
|
||||
Reference in New Issue
Block a user