深色模式、首页设置页面和功能优化
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
import org.gradle.api.JavaVersion
|
||||
import com.android.build.gradle.LibraryExtension
|
||||
import com.android.build.gradle.AppExtension
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
@@ -25,6 +29,7 @@ allprojects {
|
||||
}
|
||||
}
|
||||
|
||||
// 统一设置 JVM 版本
|
||||
allprojects {
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "17"
|
||||
@@ -38,19 +43,53 @@ allprojects {
|
||||
}
|
||||
}
|
||||
|
||||
// 注释掉 audioplayers_android 项目配置,因为我们使用的是 Git 仓库版本
|
||||
// project(":audioplayers_android") {
|
||||
// tasks.withType<JavaCompile> {
|
||||
// sourceCompatibility = "1.8"
|
||||
// targetCompatibility = "1.8"
|
||||
// }
|
||||
//
|
||||
// tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
||||
// kotlinOptions {
|
||||
// jvmTarget = "1.8"
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// 为所有子项目(包括依赖的模块)设置统一的 JVM 目标版本
|
||||
subprojects {
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "17"
|
||||
targetCompatibility = "17"
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 为所有模块设置统一的 JVM 目标版本
|
||||
subprojects {
|
||||
afterEvaluate {
|
||||
// 为 Java 编译任务设置 JVM 版本
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "17"
|
||||
targetCompatibility = "17"
|
||||
}
|
||||
|
||||
// 为 Kotlin 编译任务设置 JVM 版本
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
|
||||
// 为 Android 模块设置编译选项
|
||||
if (plugins.hasPlugin("com.android.library") || plugins.hasPlugin("com.android.application")) {
|
||||
extensions.findByType<com.android.build.gradle.LibraryExtension>()?.apply {
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
extensions.findByType<com.android.build.gradle.AppExtension>()?.apply {
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory =
|
||||
rootProject.layout.buildDirectory
|
||||
|
||||
Reference in New Issue
Block a user