build.gradle.kts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. compileOnly("org.springframework:spring-webflux:5.0.0.RELEASE")
  39. compileOnly("io.projectreactor.ipc:reactor-netty:0.7.0.RELEASE")
  40. // this is needed to pick up SpringCoreIgnoredTypesConfigurer
  41. testInstrumentation(project(":instrumentation:spring:spring-core-2.0:javaagent"))
  42. testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
  43. testInstrumentation(project(":instrumentation:reactor:reactor-3.1:javaagent"))
  44. testInstrumentation(project(":instrumentation:reactor:reactor-netty:reactor-netty-1.0:javaagent"))
  45. testImplementation(project(":instrumentation:spring:spring-webflux:spring-webflux-5.3:testing"))
  46. testLibrary("org.springframework.boot:spring-boot-starter-webflux:2.0.0.RELEASE")
  47. testLibrary("org.springframework.boot:spring-boot-starter-test:2.0.0.RELEASE")
  48. testLibrary("org.springframework.boot:spring-boot-starter-reactor-netty:2.0.0.RELEASE")
  49. testImplementation("org.spockframework:spock-spring:2.4-M1-groovy-4.0")
  50. }
  51. tasks.withType<Test>().configureEach {
  52. // TODO run tests both with and without experimental span attributes
  53. jvmArgs("-Dotel.instrumentation.spring-webflux.experimental-span-attributes=true")
  54. // required on jdk17
  55. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  56. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  57. systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
  58. }
  59. val latestDepTest = findProperty("testLatestDeps") as Boolean
  60. if (latestDepTest) {
  61. // spring 6 requires java 17
  62. otelJava {
  63. minJavaVersionSupported.set(JavaVersion.VERSION_17)
  64. }
  65. } else {
  66. // spring 5 requires old logback (and therefore also old slf4j)
  67. configurations.testRuntimeClasspath {
  68. resolutionStrategy {
  69. force("ch.qos.logback:logback-classic:1.2.11")
  70. force("org.slf4j:slf4j-api:1.7.36")
  71. }
  72. }
  73. }