mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-01 12:50:57 +08:00
Fix gradle on java-oracle
This commit is contained in:
parent
c9a4c38f79
commit
8fcdad653a
@ -51,14 +51,18 @@ include(':mirai-plugins')
|
||||
include(':mirai-plugins:image-sender')
|
||||
|
||||
def javaVersion = System.getProperty("java.version")
|
||||
try {
|
||||
if (javaVersion.substring(0, javaVersion.indexOf(".")).toInteger() >= 11) {
|
||||
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) {
|
||||
println("jdk版本为 "+ javaVersionNum)
|
||||
include(':mirai-debug')
|
||||
} else {
|
||||
println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 最低需要 JDK 11 才能引入模块 `:mirai-debug`")
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
println("无法检测 JDK 版本, 将不会引入 `:mirai-debug`")
|
||||
}
|
||||
|
||||
project(':mirai-demos:mirai-demo-1').projectDir = file('mirai-demos/mirai-demo-1')
|
||||
|
Loading…
Reference in New Issue
Block a user