mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-28 00:20:14 +08:00
Use Gradle JavaVersion API
This commit is contained in:
parent
770615f137
commit
aacdf0df2c
@ -54,15 +54,9 @@ fun includeConsoleProjects() {
|
|||||||
if (!disableOldFrontEnds) {
|
if (!disableOldFrontEnds) {
|
||||||
includeConsoleProject(":mirai-console-terminal", "frontend/mirai-console-terminal")
|
includeConsoleProject(":mirai-console-terminal", "frontend/mirai-console-terminal")
|
||||||
|
|
||||||
val jdkVersion = kotlin.runCatching {
|
println("JDK version: ${JavaVersion.current()}")
|
||||||
System.getProperty("java.version").let { v ->
|
|
||||||
v.toIntOrNull() ?: v.removePrefix("1.").substringBefore("-").toIntOrNull()
|
|
||||||
}
|
|
||||||
}.getOrNull() ?: -1
|
|
||||||
|
|
||||||
println("JDK version: $jdkVersion")
|
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
|
||||||
|
|
||||||
if (jdkVersion >= 9) {
|
|
||||||
includeConsoleProject(":mirai-console-graphical", "frontend/mirai-console-graphical")
|
includeConsoleProject(":mirai-console-graphical", "frontend/mirai-console-graphical")
|
||||||
} else {
|
} else {
|
||||||
println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 请使用 JDK 9 以上版本引入模块 `:mirai-console-graphical`\n")
|
println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 请使用 JDK 9 以上版本引入模块 `:mirai-console-graphical`\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user