build.gradle.kts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. // note that muzzle is not run against the current SNAPSHOT instrumentation-annotations, but this is
  5. // ok because the tests are run against the current SNAPSHOT instrumentation-annotations which will
  6. // catch any muzzle issues in SNAPSHOT instrumentation-annotations
  7. muzzle {
  8. pass {
  9. group.set("io.opentelemetry")
  10. module.set("opentelemetry-instrumentation-annotations")
  11. versions.set("(,)")
  12. }
  13. }
  14. dependencies {
  15. compileOnly(project(":instrumentation-annotations-support"))
  16. compileOnly(project(":javaagent-tooling"))
  17. // this instrumentation needs to do similar shading dance as opentelemetry-api-1.0 because
  18. // the @WithSpan annotation references the OpenTelemetry API's SpanKind class
  19. //
  20. // see the comment in opentelemetry-api-1.0.gradle for more details
  21. compileOnly(project(":opentelemetry-instrumentation-annotations-shaded-for-instrumenting", configuration = "shadow"))
  22. // Used by byte-buddy but not brought in as a transitive dependency.
  23. compileOnly("com.google.code.findbugs:annotations")
  24. testCompileOnly("com.google.code.findbugs:annotations")
  25. testImplementation(project(":instrumentation-annotations"))
  26. testImplementation(project(":instrumentation-annotations-support"))
  27. testImplementation("net.bytebuddy:byte-buddy")
  28. }
  29. tasks {
  30. compileTestJava {
  31. options.compilerArgs.add("-parameters")
  32. }
  33. test {
  34. jvmArgs("-Dotel.instrumentation.opentelemetry-instrumentation-annotations.exclude-methods=io.opentelemetry.test.annotation.TracedWithSpan[ignored]")
  35. }
  36. }