settings.gradle 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. pluginManagement {
  2. resolutionStrategy {
  3. eachPlugin {
  4. switch (requested.id.id) {
  5. case "org.jetbrains.kotlin.multiplatform": useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}"); break
  6. case "com.android.library": useModule("com.android.tools.build:gradle:${requested.version}"); break
  7. case "com.jfrog.bintray": useModule("com.jfrog.bintray.gradle:gradle-bintray-plugin:${requested.version}")
  8. }
  9. }
  10. }
  11. repositories {
  12. mavenLocal()
  13. jcenter()
  14. google()
  15. mavenCentral()
  16. maven { url "https://plugins.gradle.org/m2/" }
  17. maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" }
  18. }
  19. }
  20. rootProject.name = 'mirai'
  21. def keyProps = new Properties()
  22. def keyFile = file("local.properties")
  23. if (keyFile.exists()) keyFile.withInputStream { keyProps.load(it) }
  24. if (!keyProps.getProperty("sdk.dir", "").isEmpty()) {
  25. include(':mirai-demos:mirai-demo-android')
  26. project(':mirai-demos:mirai-demo-android').projectDir = file('mirai-demos/mirai-demo-android')
  27. } else {
  28. println("Android SDK 可能未安装. \n将不会加载模块 `mirai-demo-android`, 但这并不影响其他 demo 的加载 ")
  29. println("Android SDK might not be installed. \nModule `mirai-demo-android` will not be included, but other demos will not be influenced")
  30. }
  31. include(':mirai-core')
  32. include(':mirai-core-timpc')
  33. include(':mirai-core-qqandroid')
  34. include(':mirai-console')
  35. //include(':mirai-api')
  36. include(':mirai-api-http')
  37. include(':mirai-demos:mirai-demo-1')
  38. include(':mirai-demos:mirai-demo-gentleman')
  39. include(':mirai-demos')
  40. def javaVersion = System.getProperty("java.version")
  41. if (javaVersion.substring(0, javaVersion.indexOf(".")).toInteger() >= 11) {
  42. include(':mirai-debug')
  43. } else {
  44. println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 最低需要 JDK 11 才能引入模块 `:mirai-debug`")
  45. }
  46. project(':mirai-demos:mirai-demo-1').projectDir = file('mirai-demos/mirai-demo-1')
  47. project(':mirai-demos:mirai-demo-gentleman').projectDir = file('mirai-demos/mirai-demo-gentleman')
  48. enableFeaturePreview('GRADLE_METADATA')