build.gradle.kts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("io.projectreactor.kafka")
  7. module.set("reactor-kafka")
  8. versions.set("[1.0.0,)")
  9. assertInverse.set(true)
  10. }
  11. }
  12. dependencies {
  13. compileOnly(project(":muzzle"))
  14. compileOnly("com.google.auto.value:auto-value-annotations")
  15. annotationProcessor("com.google.auto.value:auto-value")
  16. bootstrap(project(":instrumentation:kafka:kafka-clients:kafka-clients-0.11:bootstrap"))
  17. implementation(project(":instrumentation:kafka:kafka-clients:kafka-clients-common:library"))
  18. implementation(project(":instrumentation:reactor:reactor-3.1:library"))
  19. // using 1.3 to be able to implement several new KafkaReceiver methods added in 1.3.3 and 1.3.21
  20. // @NoMuzzle is used to ensure that this does not break muzzle checks
  21. compileOnly("io.projectreactor.kafka:reactor-kafka:1.3.21")
  22. testInstrumentation(project(":instrumentation:kafka:kafka-clients:kafka-clients-0.11:javaagent"))
  23. testInstrumentation(project(":instrumentation:reactor:reactor-3.1:javaagent"))
  24. testImplementation(project(":instrumentation:reactor:reactor-kafka-1.0:testing"))
  25. testLibrary("io.projectreactor.kafka:reactor-kafka:1.0.0.RELEASE")
  26. latestDepTestLibrary("io.projectreactor:reactor-core:3.4.+")
  27. }
  28. val testLatestDeps = findProperty("testLatestDeps") as Boolean
  29. testing {
  30. suites {
  31. val testV1_3_3 by registering(JvmTestSuite::class) {
  32. dependencies {
  33. implementation(project(":instrumentation:reactor:reactor-kafka-1.0:testing"))
  34. if (testLatestDeps) {
  35. implementation("io.projectreactor.kafka:reactor-kafka:+")
  36. implementation("io.projectreactor:reactor-core:3.4.+")
  37. } else {
  38. implementation("io.projectreactor.kafka:reactor-kafka:1.3.3")
  39. }
  40. }
  41. targets {
  42. all {
  43. testTask.configure {
  44. systemProperty("hasConsumerGroup", true)
  45. }
  46. }
  47. }
  48. }
  49. val testV1_3_21 by registering(JvmTestSuite::class) {
  50. dependencies {
  51. implementation(project(":instrumentation:reactor:reactor-kafka-1.0:testing"))
  52. if (testLatestDeps) {
  53. implementation("io.projectreactor.kafka:reactor-kafka:+")
  54. implementation("io.projectreactor:reactor-core:3.4.+")
  55. } else {
  56. implementation("io.projectreactor.kafka:reactor-kafka:1.3.21")
  57. }
  58. }
  59. targets {
  60. all {
  61. testTask.configure {
  62. systemProperty("hasConsumerGroup", true)
  63. }
  64. }
  65. }
  66. }
  67. }
  68. }
  69. tasks {
  70. withType<Test>().configureEach {
  71. usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
  72. jvmArgs("-Dotel.instrumentation.kafka.experimental-span-attributes=true")
  73. jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=true")
  74. }
  75. test {
  76. systemProperty("hasConsumerGroup", testLatestDeps)
  77. }
  78. check {
  79. dependsOn(testing.suites)
  80. }
  81. }