build.gradle.kts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. name.set("webflux_5.0.0+_with_netty_0.8.0")
  7. group.set("org.springframework")
  8. module.set("spring-webflux")
  9. versions.set("[5.0.0.RELEASE,)")
  10. assertInverse.set(true)
  11. extraDependency("io.projectreactor.netty:reactor-netty:0.8.0.RELEASE")
  12. }
  13. pass {
  14. name.set("webflux_5.0.0_with_ipc_0.7.0")
  15. group.set("org.springframework")
  16. module.set("spring-webflux")
  17. versions.set("[5.0.0.RELEASE,)")
  18. assertInverse.set(true)
  19. extraDependency("io.projectreactor.ipc:reactor-netty:0.7.0.RELEASE")
  20. }
  21. pass {
  22. name.set("netty_0.8.0+_with_spring-webflux:5.1.0")
  23. group.set("io.projectreactor.netty")
  24. module.set("reactor-netty")
  25. versions.set("[0.8.0.RELEASE,)")
  26. extraDependency("org.springframework:spring-webflux:5.1.0.RELEASE")
  27. }
  28. pass {
  29. name.set("ipc_0.7.0+_with_spring-webflux:5.0.0")
  30. group.set("io.projectreactor.ipc")
  31. module.set("reactor-netty")
  32. versions.set("[0.7.0.RELEASE,)")
  33. extraDependency("org.springframework:spring-webflux:5.0.0.RELEASE")
  34. }
  35. }
  36. dependencies {
  37. implementation(project(":instrumentation:spring:spring-webflux:spring-webflux-5.3:library"))
  38. implementation(project(":instrumentation:netty:netty-4.1:library"))
  39. compileOnly("org.springframework:spring-webflux:5.0.0.RELEASE")
  40. compileOnly("io.projectreactor.ipc:reactor-netty:0.7.0.RELEASE")
  41. // this is needed to pick up SpringCoreIgnoredTypesConfigurer
  42. testInstrumentation(project(":instrumentation:spring:spring-core-2.0:javaagent"))
  43. testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
  44. testInstrumentation(project(":instrumentation:reactor:reactor-3.1:javaagent"))
  45. testInstrumentation(project(":instrumentation:reactor:reactor-netty:reactor-netty-1.0:javaagent"))
  46. testImplementation(project(":instrumentation:spring:spring-webflux:spring-webflux-5.0:testing"))
  47. testImplementation(project(":instrumentation:spring:spring-webflux:spring-webflux-5.3:testing"))
  48. testLibrary("org.springframework.boot:spring-boot-starter-webflux:2.0.0.RELEASE")
  49. testLibrary("org.springframework.boot:spring-boot-starter-test:2.0.0.RELEASE")
  50. testLibrary("org.springframework.boot:spring-boot-starter-reactor-netty:2.0.0.RELEASE")
  51. testImplementation("org.spockframework:spock-spring:2.4-M1-groovy-4.0")
  52. }
  53. tasks.withType<Test>().configureEach {
  54. // TODO run tests both with and without experimental span attributes
  55. jvmArgs("-Dotel.instrumentation.spring-webflux.experimental-span-attributes=true")
  56. // required on jdk17
  57. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  58. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  59. systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
  60. }
  61. val latestDepTest = findProperty("testLatestDeps") as Boolean
  62. if (latestDepTest) {
  63. // spring 6 requires java 17
  64. otelJava {
  65. minJavaVersionSupported.set(JavaVersion.VERSION_17)
  66. }
  67. } else {
  68. // spring 5 requires old logback (and therefore also old slf4j)
  69. configurations.testRuntimeClasspath {
  70. resolutionStrategy {
  71. force("ch.qos.logback:logback-classic:1.2.11")
  72. force("org.slf4j:slf4j-api:1.7.36")
  73. }
  74. }
  75. }