build.gradle.kts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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/dev/LICENSE
  8. */
  9. plugins {
  10. `java-platform`
  11. `maven-publish`
  12. }
  13. description = "Mirai BOM"
  14. rootProject.subprojects
  15. .filter { it.path != project.path }
  16. .forEach { project.evaluationDependsOn(it.path) }
  17. dependencies {
  18. constraints {
  19. rootProject.subprojects
  20. .filter { it.path != project.path }
  21. .filter { it.extensions.findByName("publishing") != null }
  22. .forEach { subProject ->
  23. subProject.publishing.publications
  24. .withType<MavenPublication>()
  25. .forEach {
  26. [email protected]("${it.groupId}:${it.artifactId}:${it.version}")
  27. }
  28. }
  29. }
  30. }
  31. publishing {
  32. publications {
  33. create<MavenPublication>("myPlatform") {
  34. groupId = rootProject.group.toString()
  35. artifactId = "mirai-bom"
  36. version = Versions.project
  37. from(components["javaPlatform"])
  38. setupPom(project)
  39. configGpgSign(project)
  40. }
  41. }
  42. }
  43. configurePublishing("mirai-bom", addProjectComponents = false)