build.gradle.kts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. plugins {
  2. id("otel.library-instrumentation")
  3. }
  4. base.archivesName.set("${base.archivesName.get()}-autoconfigure")
  5. dependencies {
  6. compileOnly(project(":javaagent-extension-api"))
  7. library("org.apache.logging.log4j:log4j-core:2.17.0")
  8. testImplementation(project(":instrumentation:log4j:log4j-context-data:log4j-context-data-common:testing"))
  9. }
  10. tasks {
  11. test {
  12. filter {
  13. excludeTestsMatching("LibraryLog4j2BaggageTest")
  14. excludeTestsMatching("LibraryLog4j2LoggingKeysTest")
  15. }
  16. }
  17. val testAddBaggage by registering(Test::class) {
  18. filter {
  19. includeTestsMatching("LibraryLog4j2BaggageTest")
  20. }
  21. jvmArgs("-Dotel.instrumentation.log4j-context-data.add-baggage=true")
  22. }
  23. val testLoggingKeys by registering(Test::class) {
  24. filter {
  25. includeTestsMatching("LibraryLog4j2LoggingKeysTest")
  26. }
  27. jvmArgs("-Dotel.instrumentation.common.logging.trace-id=trace_id_test")
  28. jvmArgs("-Dotel.instrumentation.common.logging.span-id=span_id_test")
  29. jvmArgs("-Dotel.instrumentation.common.logging.trace-flags=trace_flags_test")
  30. }
  31. named("check") {
  32. dependsOn(testAddBaggage)
  33. dependsOn(testLoggingKeys)
  34. }
  35. }