2020-06-20 22:55:07 +08:00
|
|
|
pluginManagement {
|
|
|
|
repositories {
|
2020-06-21 00:44:02 +08:00
|
|
|
mavenLocal()
|
2020-08-01 21:53:24 +08:00
|
|
|
gradlePluginPortal()
|
2020-06-20 22:55:07 +08:00
|
|
|
jcenter()
|
2020-06-21 00:44:02 +08:00
|
|
|
maven(url = "https://dl.bintray.com/kotlin/kotlin-eap")
|
2020-06-20 22:55:07 +08:00
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rootProject.name = "mirai-console"
|
|
|
|
|
2020-06-21 00:44:02 +08:00
|
|
|
val disableOldFrontEnds = true
|
2020-06-20 22:55:07 +08:00
|
|
|
|
2020-06-21 00:44:02 +08:00
|
|
|
fun includeProject(projectPath: String, path: String? = null) {
|
|
|
|
include(projectPath)
|
|
|
|
if (path != null) project(projectPath).projectDir = file(path)
|
|
|
|
}
|
2020-06-20 22:55:07 +08:00
|
|
|
|
2020-06-21 00:44:02 +08:00
|
|
|
includeProject(":mirai-console", "backend/mirai-console")
|
2020-06-21 13:32:40 +08:00
|
|
|
includeProject(":mirai-console.codegen", "backend/codegen")
|
2020-06-21 00:44:02 +08:00
|
|
|
includeProject(":mirai-console-pure", "frontend/mirai-console-pure")
|
2020-06-20 22:55:07 +08:00
|
|
|
|
|
|
|
@Suppress("ConstantConditionIf")
|
2020-06-21 00:44:02 +08:00
|
|
|
if (!disableOldFrontEnds) {
|
|
|
|
includeProject(":mirai-console-terminal", "frontend/mirai-console-terminal")
|
2020-06-20 22:55:07 +08:00
|
|
|
|
2020-06-21 00:44:02 +08:00
|
|
|
val jdkVersion = kotlin.runCatching {
|
|
|
|
System.getProperty("java.version").let { v ->
|
|
|
|
v.toIntOrNull() ?: v.removePrefix("1.").substringBefore("-").toIntOrNull()
|
2020-06-20 22:55:07 +08:00
|
|
|
}
|
2020-06-21 00:44:02 +08:00
|
|
|
}.getOrNull() ?: -1
|
2020-06-20 22:55:07 +08:00
|
|
|
|
2020-06-21 00:44:02 +08:00
|
|
|
println("JDK version: $jdkVersion")
|
|
|
|
|
|
|
|
if (jdkVersion >= 9) {
|
|
|
|
includeProject(":mirai-console-graphical", "frontend/mirai-console-graphical")
|
|
|
|
} else {
|
|
|
|
println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 请使用 JDK 9 以上版本引入模块 `:mirai-console-graphical`\n")
|
2020-06-20 22:55:07 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
enableFeaturePreview("GRADLE_METADATA")
|