settings.gradle.kts 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. if (System.getProperty("use.maven.local") == "true") {
  12. mavenLocal()
  13. }
  14. // mavenLocal()
  15. gradlePluginPortal()
  16. mavenCentral()
  17. google()
  18. }
  19. }
  20. rootProject.name = "mirai"
  21. fun includeProject(projectPath: String, dir: String? = null) {
  22. include(projectPath)
  23. if (dir != null) project(projectPath).projectDir = file(dir)
  24. }
  25. include(":mirai-core-utils")
  26. include(":mirai-core-api")
  27. include(":mirai-core")
  28. include(":mirai-core-all")
  29. include(":mirai-bom")
  30. include(":binary-compatibility-validator")
  31. include(":binary-compatibility-validator-android")
  32. project(":binary-compatibility-validator-android").projectDir = file("binary-compatibility-validator/android")
  33. includeProject(":mirai-logging-log4j2", "logging/mirai-logging-log4j2")
  34. includeProject(":mirai-logging-slf4j", "logging/mirai-logging-slf4j")
  35. includeProject(":mirai-logging-slf4j-simple", "logging/mirai-logging-slf4j-simple")
  36. includeProject(":mirai-logging-slf4j-logback", "logging/mirai-logging-slf4j-logback")
  37. fun includeConsoleProjects() {
  38. val disableOldFrontEnds = true
  39. fun includeConsoleProject(projectPath: String, dir: String? = null) =
  40. includeProject(projectPath, "mirai-console/$dir")
  41. includeConsoleProject(":mirai-console-compiler-annotations", "tools/compiler-annotations")
  42. includeConsoleProject(":mirai-console", "backend/mirai-console")
  43. includeConsoleProject(":mirai-console.codegen", "backend/codegen")
  44. includeConsoleProject(":mirai-console-terminal", "frontend/mirai-console-terminal")
  45. includeConsoleProject(":mirai-console-compiler-common", "tools/compiler-common")
  46. includeConsoleProject(":mirai-console-intellij", "tools/intellij-plugin")
  47. includeConsoleProject(":mirai-console-gradle", "tools/gradle-plugin")
  48. @Suppress("ConstantConditionIf")
  49. if (!disableOldFrontEnds) {
  50. includeConsoleProject(":mirai-console-terminal", "frontend/mirai-console-terminal")
  51. println("JDK version: ${JavaVersion.current()}")
  52. if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
  53. includeConsoleProject(":mirai-console-graphical", "frontend/mirai-console-graphical")
  54. } else {
  55. println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 请使用 JDK 9 以上版本引入模块 `:mirai-console-graphical`\n")
  56. }
  57. }
  58. }
  59. fun isMiraiConsoleCloned(): Boolean {
  60. return file("mirai-console/build.gradle.kts").exists()
  61. }
  62. if (isMiraiConsoleCloned()) {
  63. includeConsoleProjects()
  64. } else {
  65. logger.warn(
  66. """
  67. [mirai] mirai-console submodule is not configured.
  68. Please execute `git submodule init` and `git submodule update` to include mirai-console build if you want.
  69. If you develop only on mirai-core, it's not compulsory to include mirai-console.
  70. """.trimIndent()
  71. )
  72. }
  73. include(":ci-release-helper")