build.gradle.kts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. plugins {
  2. id("org.xbib.gradle.plugin.jflex")
  3. id("otel.java-conventions")
  4. id("otel.animalsniffer-conventions")
  5. id("otel.jacoco-conventions")
  6. id("otel.japicmp-conventions")
  7. id("otel.publish-conventions")
  8. }
  9. group = "io.opentelemetry.instrumentation"
  10. dependencies {
  11. api("io.opentelemetry:opentelemetry-semconv")
  12. api(project(":instrumentation-api"))
  13. compileOnly("com.google.auto.value:auto-value-annotations")
  14. annotationProcessor("com.google.auto.value:auto-value")
  15. testImplementation(project(":testing-common"))
  16. testImplementation("io.opentelemetry:opentelemetry-sdk-metrics")
  17. testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
  18. }
  19. tasks {
  20. // exclude auto-generated code
  21. named<Checkstyle>("checkstyleMain") {
  22. exclude("**/AutoSqlSanitizer.java")
  23. }
  24. // Work around https://github.com/jflex-de/jflex/issues/762
  25. compileJava {
  26. with(options) {
  27. compilerArgs.add("-Xlint:-fallthrough")
  28. }
  29. }
  30. sourcesJar {
  31. dependsOn("generateJflex")
  32. }
  33. val testStatementSanitizerConfig by registering(Test::class) {
  34. filter {
  35. includeTestsMatching("StatementSanitizationConfigTest")
  36. }
  37. include("**/StatementSanitizationConfigTest.*")
  38. jvmArgs("-Dotel.instrumentation.common.db-statement-sanitizer.enabled=false")
  39. }
  40. test {
  41. filter {
  42. excludeTestsMatching("StatementSanitizationConfigTest")
  43. }
  44. }
  45. check {
  46. dependsOn(testStatementSanitizerConfig)
  47. }
  48. }