settings.gradle.kts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright 2019-2021 Mamoe Technologies and contributors.
  3. *
  4. * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  5. * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  6. *
  7. * https://github.com/mamoe/mirai/blob/master/LICENSE
  8. */
  9. pluginManagement {
  10. repositories {
  11. mavenLocal()
  12. gradlePluginPortal()
  13. jcenter()
  14. maven(url = "https://dl.bintray.com/kotlin/kotlin-eap")
  15. mavenCentral()
  16. }
  17. }
  18. rootProject.name = "mirai-console"
  19. val disableOldFrontEnds = true
  20. fun includeProject(projectPath: String, path: String? = null) {
  21. include(projectPath)
  22. if (path != null) project(projectPath).projectDir = file(path)
  23. }
  24. includeProject(":mirai-console-compiler-annotations", "tools/compiler-annotations")
  25. includeProject(":mirai-console", "backend/mirai-console")
  26. includeProject(":mirai-console.codegen", "backend/codegen")
  27. includeProject(":mirai-console-terminal", "frontend/mirai-console-terminal")
  28. includeProject(":mirai-console-compiler-common", "tools/compiler-common")
  29. includeProject(":mirai-console-intellij", "tools/intellij-plugin")
  30. includeProject(":mirai-console-gradle", "tools/gradle-plugin")
  31. @Suppress("ConstantConditionIf")
  32. if (!disableOldFrontEnds) {
  33. includeProject(":mirai-console-terminal", "frontend/mirai-console-terminal")
  34. val jdkVersion = kotlin.runCatching {
  35. System.getProperty("java.version").let { v ->
  36. v.toIntOrNull() ?: v.removePrefix("1.").substringBefore("-").toIntOrNull()
  37. }
  38. }.getOrNull() ?: -1
  39. println("JDK version: $jdkVersion")
  40. if (jdkVersion >= 9) {
  41. includeProject(":mirai-console-graphical", "frontend/mirai-console-graphical")
  42. } else {
  43. println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 请使用 JDK 9 以上版本引入模块 `:mirai-console-graphical`\n")
  44. }
  45. }
  46. enableFeaturePreview("GRADLE_METADATA")