build.gradle.kts 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. // context "leak" here is intentional: spring-integration instrumentation will always override
  5. // "local" span context with one extracted from the incoming message when it decides to start a
  6. // CONSUMER span
  7. extra["failOnContextLeak"] = false
  8. muzzle {
  9. pass {
  10. group.set("org.springframework.integration")
  11. module.set("spring-integration-core")
  12. versions.set("[4.1.0.RELEASE,)")
  13. assertInverse.set(true)
  14. }
  15. }
  16. dependencies {
  17. implementation(project(":instrumentation:spring:spring-integration-4.1:library"))
  18. library("org.springframework.integration:spring-integration-core:4.1.0.RELEASE")
  19. testInstrumentation(project(":instrumentation:rabbitmq-2.7:javaagent"))
  20. testInstrumentation(project(":instrumentation:spring:spring-rabbit-1.0:javaagent"))
  21. testImplementation(project(":instrumentation:spring:spring-integration-4.1:testing"))
  22. testLibrary("org.springframework.boot:spring-boot-starter-test:1.5.22.RELEASE")
  23. testLibrary("org.springframework.boot:spring-boot-starter:1.5.22.RELEASE")
  24. testLibrary("org.springframework.cloud:spring-cloud-stream:2.2.1.RELEASE")
  25. testLibrary("org.springframework.cloud:spring-cloud-stream-binder-rabbit:2.2.1.RELEASE")
  26. testImplementation("javax.servlet:javax.servlet-api:3.1.0")
  27. latestDepTestLibrary("org.springframework.integration:spring-integration-core:5.+")
  28. latestDepTestLibrary("org.springframework.boot:spring-boot-starter-test:2.+")
  29. latestDepTestLibrary("org.springframework.boot:spring-boot-starter:2.+")
  30. latestDepTestLibrary("org.springframework.cloud:spring-cloud-stream:3.+")
  31. latestDepTestLibrary("org.springframework.cloud:spring-cloud-stream-binder-rabbit:3.+")
  32. }
  33. tasks {
  34. val testWithRabbitInstrumentation by registering(Test::class) {
  35. filter {
  36. includeTestsMatching("SpringIntegrationAndRabbitTest")
  37. }
  38. include("**/SpringIntegrationAndRabbitTest.*")
  39. jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=true")
  40. jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=true")
  41. }
  42. val testWithProducerInstrumentation by registering(Test::class) {
  43. filter {
  44. includeTestsMatching("SpringCloudStreamProducerTest")
  45. }
  46. include("**/SpringCloudStreamProducerTest.*")
  47. jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=false")
  48. jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=false")
  49. jvmArgs("-Dotel.instrumentation.spring-integration.producer.enabled=true")
  50. }
  51. test {
  52. filter {
  53. excludeTestsMatching("SpringIntegrationAndRabbitTest")
  54. excludeTestsMatching("SpringCloudStreamProducerTest")
  55. }
  56. jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=false")
  57. jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=false")
  58. }
  59. check {
  60. dependsOn(testWithRabbitInstrumentation)
  61. dependsOn(testWithProducerInstrumentation)
  62. }
  63. withType<Test>().configureEach {
  64. systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
  65. usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
  66. }
  67. }
  68. configurations.testRuntimeClasspath {
  69. resolutionStrategy {
  70. // requires old logback (and therefore also old slf4j)
  71. force("ch.qos.logback:logback-classic:1.2.11")
  72. force("org.slf4j:slf4j-api:1.7.36")
  73. }
  74. }