feat: 服务器断线提醒; fix: 强制子项目 Java 17 消除源值8警告

This commit is contained in:
ZV Dev committed 2026-10-23 19:48:05 +08:00
1 parent e868493bb6
commit 3404ffe83a
2 files changed
+69 -1

No files matched your search

+18
View File
@@ -63,3 +63,21 @@ subprojects {
tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}
// 强制所有子项目(含插件模块)使用 Java 17,消除 "源值 8/目标值 8 已过时" 警告
gradle.beforeProject {
if (project != rootProject) {
tasks.withType(JavaCompile::class.java).configureEach {
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}
plugins.withId("com.android.library") {
extensions.findByType(com.android.build.api.dsl.LibraryExtension::class.java)?.apply {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
}
}
}