build.gradle.kts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. plugins {
  2. id("otel.library-instrumentation")
  3. }
  4. dependencies {
  5. compileOnly(project(":muzzle"))
  6. compileOnly("com.google.auto.value:auto-value-annotations")
  7. annotationProcessor("com.google.auto.value:auto-value")
  8. implementation(project(":instrumentation:kafka:kafka-clients:kafka-clients-common:library"))
  9. // compiling against 2.8.0 to use methods that are not present in 2.7
  10. compileOnly("org.springframework.kafka:spring-kafka:2.8.0")
  11. testImplementation(project(":instrumentation:spring:spring-kafka-2.7:testing"))
  12. testImplementation(project(":instrumentation:kafka:kafka-clients:kafka-clients-2.6:library"))
  13. // 2.7.0 has a bug that makes decorating a Kafka Producer impossible
  14. testLibrary("org.springframework.kafka:spring-kafka:2.7.1")
  15. testLibrary("org.springframework.boot:spring-boot-starter-test:2.5.3")
  16. testLibrary("org.springframework.boot:spring-boot-starter:2.5.3")
  17. }
  18. tasks.withType<Test>().configureEach {
  19. usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
  20. systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
  21. }
  22. val latestDepTest = findProperty("testLatestDeps") as Boolean
  23. // spring 6 (which spring-kafka 3.+ uses) requires java 17
  24. if (latestDepTest) {
  25. otelJava {
  26. minJavaVersionSupported.set(JavaVersion.VERSION_17)
  27. }
  28. }
  29. // spring 6 uses slf4j 2.0
  30. if (!latestDepTest) {
  31. configurations.testRuntimeClasspath {
  32. resolutionStrategy {
  33. // requires old logback (and therefore also old slf4j)
  34. force("ch.qos.logback:logback-classic:1.2.11")
  35. force("org.slf4j:slf4j-api:1.7.36")
  36. }
  37. }
  38. }