build.gradle.kts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. val versions: Map<String, String> by project
  15. dependencies {
  16. compileOnly(project(":instrumentation-annotations-support"))
  17. compileOnly(project(":javaagent-tooling"))
  18. // this instrumentation needs to do similar shading dance as opentelemetry-api-1.0 because
  19. // the @WithSpan annotation references the OpenTelemetry API's SpanKind class
  20. //
  21. // see the comment in opentelemetry-api-1.0.gradle for more details
  22. compileOnly(project(":opentelemetry-instrumentation-annotations-shaded-for-instrumenting", configuration = "shadow"))
  23. testImplementation(project(":instrumentation-annotations"))
  24. testImplementation(project(":instrumentation-annotations-support"))
  25. testImplementation("net.bytebuddy:byte-buddy")
  26. }
  27. tasks {
  28. compileTestJava {
  29. options.compilerArgs.add("-parameters")
  30. }
  31. test {
  32. jvmArgs("-Dotel.instrumentation.opentelemetry-annotations.exclude-methods=io.opentelemetry.test.annotation.TracedWithSpan[ignored]")
  33. }
  34. }