build.gradle.kts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("org.springframework.cloud")
  7. module.set("spring-cloud-starter-gateway")
  8. versions.set("[2.0.0.RELEASE,]")
  9. }
  10. }
  11. dependencies {
  12. library("org.springframework.cloud:spring-cloud-starter-gateway:2.0.0.RELEASE")
  13. testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
  14. testInstrumentation(project(":instrumentation:reactor:reactor-3.1:javaagent"))
  15. testInstrumentation(project(":instrumentation:reactor:reactor-netty:reactor-netty-1.0:javaagent"))
  16. testInstrumentation(project(":instrumentation:spring:spring-webflux:spring-webflux-5.0:javaagent"))
  17. testImplementation(project(":instrumentation:spring:spring-cloud-gateway:spring-cloud-gateway-common:testing"))
  18. testLibrary("org.springframework.boot:spring-boot-starter-test:2.0.0.RELEASE")
  19. }
  20. tasks.withType<Test>().configureEach {
  21. jvmArgs("-Dotel.instrumentation.spring-cloud-gateway.experimental-span-attributes=true")
  22. // required on jdk17
  23. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  24. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  25. systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
  26. }
  27. val latestDepTest = findProperty("testLatestDeps") as Boolean
  28. if (latestDepTest) {
  29. // spring 6 requires java 17
  30. otelJava {
  31. minJavaVersionSupported.set(JavaVersion.VERSION_17)
  32. }
  33. } else {
  34. // spring 5 requires old logback (and therefore also old slf4j)
  35. configurations.testRuntimeClasspath {
  36. resolutionStrategy {
  37. force("ch.qos.logback:logback-classic:1.2.11")
  38. force("org.slf4j:slf4j-api:1.7.36")
  39. }
  40. }
  41. }