build.gradle.kts 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. plugins {
  2. `java-platform`
  3. }
  4. data class DependencySet(val group: String, val version: String, val modules: List<String>)
  5. val dependencyVersions = hashMapOf<String, String>()
  6. rootProject.extra["versions"] = dependencyVersions
  7. // this line is managed by .github/scripts/update-sdk-version.sh
  8. val otelSdkVersion = "1.39.0"
  9. val otelContribVersion = "1.36.0-alpha"
  10. val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
  11. // Need both BOM and groovy jars
  12. val groovyVersion = "4.0.21"
  13. // We don't force libraries we instrument to new versions since we compile and test against specific
  14. // old baseline versions but we do try to force those libraries' transitive dependencies to new
  15. // versions where possible so that we don't end up with explosion of dependency versions in
  16. // Intellij, which causes Intellij to spend lots of time indexing all of those different dependency
  17. // versions, and makes debugging painful because Intellij has no idea which dependency version's
  18. // source to use when stepping through code.
  19. //
  20. // Sometimes libraries we instrument do require a specific version of a transitive dependency and
  21. // that can be applied in the specific instrumentation gradle file, e.g.
  22. // configurations.testRuntimeClasspath.resolutionStrategy.force "com.google.guava:guava:19.0"
  23. val DEPENDENCY_BOMS = listOf(
  24. "com.fasterxml.jackson:jackson-bom:2.17.1",
  25. "com.squareup.okio:okio-bom:3.9.0", // see https://github.com/open-telemetry/opentelemetry-java/issues/5637
  26. "com.google.guava:guava-bom:33.2.1-jre",
  27. "org.apache.groovy:groovy-bom:${groovyVersion}",
  28. "io.opentelemetry:opentelemetry-bom:${otelSdkVersion}",
  29. "io.opentelemetry:opentelemetry-bom-alpha:${otelSdkAlphaVersion}",
  30. "org.junit:junit-bom:5.10.2",
  31. "org.testcontainers:testcontainers-bom:1.19.8",
  32. "org.spockframework:spock-bom:2.4-M4-groovy-4.0"
  33. )
  34. val autoServiceVersion = "1.1.1"
  35. val autoValueVersion = "1.11.0"
  36. val errorProneVersion = "2.28.0"
  37. val byteBuddyVersion = "1.14.17"
  38. val asmVersion = "9.7"
  39. val jmhVersion = "1.37"
  40. val mockitoVersion = "4.11.0"
  41. val slf4jVersion = "2.0.13"
  42. val semConvVersion = "1.25.0-alpha"
  43. val CORE_DEPENDENCIES = listOf(
  44. "io.opentelemetry.semconv:opentelemetry-semconv:${semConvVersion}",
  45. "io.opentelemetry.semconv:opentelemetry-semconv-incubating:${semConvVersion}",
  46. "com.google.auto.service:auto-service:${autoServiceVersion}",
  47. "com.google.auto.service:auto-service-annotations:${autoServiceVersion}",
  48. "com.google.auto.value:auto-value:${autoValueVersion}",
  49. "com.google.auto.value:auto-value-annotations:${autoValueVersion}",
  50. "com.google.errorprone:error_prone_annotations:${errorProneVersion}",
  51. "com.google.errorprone:error_prone_core:${errorProneVersion}",
  52. "com.google.errorprone:error_prone_test_helpers:${errorProneVersion}",
  53. // When updating, also update conventions/build.gradle.kts
  54. "net.bytebuddy:byte-buddy:${byteBuddyVersion}",
  55. "net.bytebuddy:byte-buddy-dep:${byteBuddyVersion}",
  56. "net.bytebuddy:byte-buddy-agent:${byteBuddyVersion}",
  57. "net.bytebuddy:byte-buddy-gradle-plugin:${byteBuddyVersion}",
  58. "org.ow2.asm:asm:${asmVersion}",
  59. "org.ow2.asm:asm-tree:${asmVersion}",
  60. "org.ow2.asm:asm-util:${asmVersion}",
  61. "org.openjdk.jmh:jmh-core:${jmhVersion}",
  62. "org.openjdk.jmh:jmh-generator-bytecode:${jmhVersion}",
  63. "org.mockito:mockito-core:${mockitoVersion}",
  64. "org.mockito:mockito-junit-jupiter:${mockitoVersion}",
  65. "org.mockito:mockito-inline:${mockitoVersion}",
  66. "org.slf4j:slf4j-api:${slf4jVersion}",
  67. "org.slf4j:slf4j-simple:${slf4jVersion}",
  68. "org.slf4j:log4j-over-slf4j:${slf4jVersion}",
  69. "org.slf4j:jcl-over-slf4j:${slf4jVersion}",
  70. "org.slf4j:jul-to-slf4j:${slf4jVersion}"
  71. )
  72. // See the comment above about why we keep this rather large list.
  73. // There are dependencies included here that appear to have no usages, but are maintained at
  74. // this top level to help consistently satisfy large numbers of transitive dependencies.
  75. val DEPENDENCIES = listOf(
  76. "io.r2dbc:r2dbc-proxy:1.1.5.RELEASE",
  77. "ch.qos.logback:logback-classic:1.3.14", // 1.4+ requires Java 11+
  78. "com.github.stefanbirkner:system-lambda:1.2.1",
  79. "com.github.stefanbirkner:system-rules:1.19.0",
  80. "uk.org.webcompere:system-stubs-jupiter:2.0.3",
  81. "com.uber.nullaway:nullaway:0.11.0",
  82. "commons-beanutils:commons-beanutils:1.9.4",
  83. "commons-cli:commons-cli:1.8.0",
  84. "commons-codec:commons-codec:1.17.0",
  85. "commons-collections:commons-collections:3.2.2",
  86. "commons-digester:commons-digester:2.1",
  87. "commons-fileupload:commons-fileupload:1.5",
  88. "commons-io:commons-io:2.16.1",
  89. "commons-lang:commons-lang:2.6",
  90. "commons-logging:commons-logging:1.3.2",
  91. "commons-validator:commons-validator:1.9.0",
  92. "io.netty:netty:3.10.6.Final",
  93. "io.opentelemetry.contrib:opentelemetry-aws-resources:${otelContribVersion}",
  94. "io.opentelemetry.contrib:opentelemetry-aws-xray-propagator:${otelContribVersion}",
  95. "io.opentelemetry.contrib:opentelemetry-gcp-resources:${otelContribVersion}",
  96. "io.opentelemetry.proto:opentelemetry-proto:1.3.1-alpha",
  97. "io.opentelemetry:opentelemetry-extension-annotations:1.18.0", // deprecated, no longer part of bom
  98. "org.assertj:assertj-core:3.26.0",
  99. "org.awaitility:awaitility:4.2.1",
  100. "com.google.code.findbugs:annotations:3.0.1u2",
  101. "com.google.code.findbugs:jsr305:3.0.2",
  102. "org.apache.groovy:groovy:${groovyVersion}",
  103. "org.apache.groovy:groovy-json:${groovyVersion}",
  104. "org.codehaus.mojo:animal-sniffer-annotations:1.23",
  105. "org.junit-pioneer:junit-pioneer:1.9.1",
  106. "org.objenesis:objenesis:3.4",
  107. "javax.validation:validation-api:2.0.1.Final",
  108. "org.snakeyaml:snakeyaml-engine:2.7"
  109. )
  110. javaPlatform {
  111. allowDependencies()
  112. }
  113. dependencies {
  114. for (bom in DEPENDENCY_BOMS) {
  115. api(enforcedPlatform(bom))
  116. val split = bom.split(':')
  117. dependencyVersions[split[0]] = split[2]
  118. }
  119. constraints {
  120. for (dependency in CORE_DEPENDENCIES) {
  121. api(dependency)
  122. val split = dependency.split(':')
  123. dependencyVersions[split[0]] = split[2]
  124. }
  125. for (dependency in DEPENDENCIES) {
  126. api(dependency)
  127. val split = dependency.split(':')
  128. dependencyVersions[split[0]] = split[2]
  129. }
  130. }
  131. }