build.gradle.kts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. compileOnly("org.springframework.kafka:spring-kafka:2.7.0")
  10. testImplementation(project(":instrumentation:spring:spring-kafka-2.7:testing"))
  11. testImplementation(project(":instrumentation:kafka:kafka-clients:kafka-clients-2.6:library"))
  12. // 2.7.0 has a bug that makes decorating a Kafka Producer impossible
  13. testLibrary("org.springframework.kafka:spring-kafka:2.7.1")
  14. testLibrary("org.springframework.boot:spring-boot-starter-test:2.5.3")
  15. testLibrary("org.springframework.boot:spring-boot-starter:2.5.3")
  16. }
  17. tasks.withType<Test>().configureEach {
  18. usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
  19. systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
  20. }
  21. val latestDepTest = findProperty("testLatestDeps") as Boolean
  22. // spring 6 (which spring-kafka 3.+ uses) requires java 17
  23. if (latestDepTest) {
  24. otelJava {
  25. minJavaVersionSupported.set(JavaVersion.VERSION_17)
  26. }
  27. }
  28. // spring 6 uses slf4j 2.0
  29. if (!latestDepTest) {
  30. configurations.testRuntimeClasspath {
  31. resolutionStrategy {
  32. // requires old logback (and therefore also old slf4j)
  33. force("ch.qos.logback:logback-classic:1.2.11")
  34. force("org.slf4j:slf4j-api:1.7.36")
  35. }
  36. }
  37. }