buildscript: always include mirai-console

This commit is contained in:
Him188 2021-12-06 12:27:58 +00:00
parent e1a5426546
commit 39dd1d5f7a

View File

@ -43,48 +43,30 @@ includeProject(":mirai-logging-slf4j-simple", "logging/mirai-logging-slf4j-simpl
includeProject(":mirai-logging-slf4j-logback", "logging/mirai-logging-slf4j-logback")
fun includeConsoleProjects() {
val disableOldFrontEnds = true
val disableOldFrontEnds = true
fun includeConsoleProject(projectPath: String, dir: String? = null) =
includeProject(projectPath, "mirai-console/$dir")
fun includeConsoleProject(projectPath: String, dir: String? = null) =
includeProject(projectPath, "mirai-console/$dir")
includeConsoleProject(":mirai-console-compiler-annotations", "tools/compiler-annotations")
includeConsoleProject(":mirai-console", "backend/mirai-console")
includeConsoleProject(":mirai-console.codegen", "backend/codegen")
includeConsoleProject(":mirai-console-compiler-annotations", "tools/compiler-annotations")
includeConsoleProject(":mirai-console", "backend/mirai-console")
includeConsoleProject(":mirai-console.codegen", "backend/codegen")
includeConsoleProject(":mirai-console-terminal", "frontend/mirai-console-terminal")
includeConsoleProject(":mirai-console-compiler-common", "tools/compiler-common")
includeConsoleProject(":mirai-console-intellij", "tools/intellij-plugin")
includeConsoleProject(":mirai-console-gradle", "tools/gradle-plugin")
@Suppress("ConstantConditionIf")
if (!disableOldFrontEnds) {
includeConsoleProject(":mirai-console-terminal", "frontend/mirai-console-terminal")
includeConsoleProject(":mirai-console-compiler-common", "tools/compiler-common")
includeConsoleProject(":mirai-console-intellij", "tools/intellij-plugin")
includeConsoleProject(":mirai-console-gradle", "tools/gradle-plugin")
@Suppress("ConstantConditionIf")
if (!disableOldFrontEnds) {
includeConsoleProject(":mirai-console-terminal", "frontend/mirai-console-terminal")
println("JDK version: ${JavaVersion.current()}")
println("JDK version: ${JavaVersion.current()}")
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
includeConsoleProject(":mirai-console-graphical", "frontend/mirai-console-graphical")
} else {
println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 请使用 JDK 9 以上版本引入模块 `:mirai-console-graphical`\n")
}
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
includeConsoleProject(":mirai-console-graphical", "frontend/mirai-console-graphical")
} else {
println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 请使用 JDK 9 以上版本引入模块 `:mirai-console-graphical`\n")
}
}
fun isMiraiConsoleCloned(): Boolean {
return file("mirai-console/build.gradle.kts").exists()
}
if (isMiraiConsoleCloned()) {
includeConsoleProjects()
} else {
logger.warn(
"""
[mirai] mirai-console submodule is not configured.
Please execute `git submodule init` and `git submodule update` to include mirai-console build if you want.
If you develop only on mirai-core, it's not compulsory to include mirai-console.
""".trimIndent()
)
}
include(":ci-release-helper")