build.gradle.kts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. plugins {
  2. id("otel.library-instrumentation")
  3. }
  4. testing {
  5. suites {
  6. val addBaggageTest by registering(JvmTestSuite::class) {
  7. targets {
  8. all {
  9. testTask.configure {
  10. jvmArgs("-Dotel.instrumentation.logback-mdc.add-baggage=true")
  11. }
  12. }
  13. }
  14. }
  15. val loggingKeysTest by registering(JvmTestSuite::class) {
  16. targets {
  17. all {
  18. testTask.configure {
  19. jvmArgs("-Dotel.instrumentation.common.logging.trace-id=trace_id_test")
  20. jvmArgs("-Dotel.instrumentation.common.logging.span-id=span_id_test")
  21. jvmArgs("-Dotel.instrumentation.common.logging.trace-flags=trace_flags_test")
  22. }
  23. }
  24. }
  25. }
  26. withType(JvmTestSuite::class) {
  27. dependencies {
  28. if (findProperty("testLatestDeps") as Boolean) {
  29. implementation("ch.qos.logback:logback-classic:+")
  30. } else {
  31. implementation("ch.qos.logback:logback-classic") {
  32. version {
  33. strictly("1.0.0")
  34. }
  35. }
  36. implementation("org.slf4j:slf4j-api") {
  37. version {
  38. strictly("1.6.4")
  39. }
  40. }
  41. }
  42. implementation(project(":instrumentation:logback:logback-mdc-1.0:testing"))
  43. implementation(project(":instrumentation:logback:logback-mdc-1.0:library"))
  44. }
  45. }
  46. }
  47. }
  48. dependencies {
  49. // pin the version strictly to avoid overriding by dependencyManagement versions
  50. compileOnly("ch.qos.logback:logback-classic") {
  51. version {
  52. strictly("1.0.0")
  53. }
  54. }
  55. compileOnly("org.slf4j:slf4j-api") {
  56. version {
  57. strictly("1.6.4")
  58. }
  59. }
  60. }
  61. tasks {
  62. named("check") {
  63. dependsOn(testing.suites)
  64. }
  65. }