2020-02-27 13:18:33 +08:00
|
|
|
pluginManagement {
|
|
|
|
resolutionStrategy {
|
|
|
|
eachPlugin {
|
|
|
|
switch (requested.id.id) {
|
|
|
|
case "org.jetbrains.kotlin.multiplatform": useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}"); break
|
|
|
|
case "com.android.library": useModule("com.android.tools.build:gradle:${requested.version}"); break
|
|
|
|
case "com.jfrog.bintray": useModule("com.jfrog.bintray.gradle:gradle-bintray-plugin:${requested.version}")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
|
|
|
jcenter()
|
|
|
|
google()
|
|
|
|
mavenCentral()
|
|
|
|
maven { url "https://plugins.gradle.org/m2/" }
|
|
|
|
maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" }
|
2020-03-29 15:58:35 +08:00
|
|
|
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
|
|
|
|
maven { url 'https://plugins.gradle.org/m2/' }
|
2020-02-27 13:18:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rootProject.name = 'mirai-console'
|
|
|
|
|
|
|
|
include(':mirai-console')
|
|
|
|
include(':mirai-console-terminal')
|
2020-03-05 17:29:12 +08:00
|
|
|
include(':mirai-console-wrapper')
|
2020-02-27 13:18:33 +08:00
|
|
|
|
|
|
|
try{
|
|
|
|
def javaVersion = System.getProperty("java.version")
|
|
|
|
def versionPos = javaVersion.indexOf(".")
|
2020-03-24 15:19:43 +08:00
|
|
|
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()
|
2020-02-27 13:18:33 +08:00
|
|
|
}
|
|
|
|
}
|
2020-03-28 17:04:14 +08:00
|
|
|
if (javaVersionNum >= 9) {
|
2020-03-24 15:19:43 +08:00
|
|
|
include(':mirai-console-graphical')
|
|
|
|
} else {
|
|
|
|
println("jdk版本为 "+ javaVersionNum)
|
2020-03-28 17:04:14 +08:00
|
|
|
println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 请使用JDK 9以上版本引入模块 `:mirai-console-graphical`\n")
|
2020-03-24 15:19:43 +08:00
|
|
|
}
|
|
|
|
|
2020-02-27 13:18:33 +08:00
|
|
|
}catch(Exception ignored){
|
|
|
|
println("无法确定 JDK 版本, 将不会引入 `:mirai-console-graphical`")
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
enableFeaturePreview('GRADLE_METADATA')
|