mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-23 22:00:10 +08:00
Make graphic support jdk 1.8 only
This commit is contained in:
parent
bd69e22854
commit
532f162d44
@ -1,15 +1,15 @@
|
||||
plugins {
|
||||
id("kotlinx-serialization")
|
||||
id("org.openjfx.javafxplugin") version "0.0.8"
|
||||
// id("org.openjfx.javafxplugin") version "0.0.8"
|
||||
id("kotlin")
|
||||
id("java")
|
||||
}
|
||||
|
||||
javafx {
|
||||
version = "13.0.2"
|
||||
modules = listOf("javafx.controls")
|
||||
//mainClassName = "Application"
|
||||
}
|
||||
//javafx {
|
||||
// version = "13.0.2"
|
||||
// modules = listOf("javafx.controls")
|
||||
// //mainClassName = "Application"
|
||||
//}
|
||||
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
|
||||
@ -43,7 +43,7 @@ dependencies {
|
||||
api(project(":mirai-console"))
|
||||
|
||||
api(group = "no.tornado", name = "tornadofx", version = "1.7.19")
|
||||
api(group = "com.jfoenix", name = "jfoenix", version = "9.0.8")
|
||||
api(group = "com.jfoenix", name = "jfoenix", version = "8.0.8")
|
||||
|
||||
testApi(group = "org.yaml", name = "snakeyaml", version = "1.25")
|
||||
}
|
||||
|
@ -28,18 +28,26 @@ include(':mirai-console-wrapper')
|
||||
try{
|
||||
def javaVersion = System.getProperty("java.version")
|
||||
def versionPos = javaVersion.indexOf(".")
|
||||
if (versionPos==-1) versionPos = javaVersion.indexOf("-")
|
||||
if (versionPos==-1){
|
||||
println("jdk version unknown")
|
||||
}else{
|
||||
def javaVersionNum = javaVersion.substring(0, versionPos).toInteger()
|
||||
if (javaVersionNum >= 11) {
|
||||
include(':mirai-console-graphical')
|
||||
} else {
|
||||
println("jdk版本为 "+ javaVersionNum)
|
||||
println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 最低需要 JDK 11 才能引入模块 `:mirai-console-graphical`")
|
||||
def javaVersionNum = javaVersion.substring(0, 1).toInteger()
|
||||
|
||||
if (javaVersion.startsWith("1.")) {
|
||||
javaVersionNum = javaVersion.substring(2, 3).toInteger()
|
||||
} else {
|
||||
if (versionPos==-1) versionPos = javaVersion.indexOf("-")
|
||||
if (versionPos==-1){
|
||||
println("jdk version unknown")
|
||||
}else{
|
||||
javaVersionNum = javaVersion.substring(0, versionPos).toInteger()
|
||||
}
|
||||
}
|
||||
if (javaVersionNum <= 8) {
|
||||
include(':mirai-console-graphical')
|
||||
} else {
|
||||
println("jdk版本为 "+ javaVersionNum)
|
||||
println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 模块 `:mirai-console-graphical`不支持JDK 9+\n" +
|
||||
"请使用OracleJDK 1.8 或使用OpenJDK 1.8并添加Java Fx依赖")
|
||||
}
|
||||
|
||||
}catch(Exception ignored){
|
||||
println("无法确定 JDK 版本, 将不会引入 `:mirai-console-graphical`")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user