build.gradle.kts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright The OpenTelemetry Authors
  3. * SPDX-License-Identifier: Apache-2.0
  4. */
  5. plugins {
  6. id("com.github.johnrengelman.shadow")
  7. id("otel.library-instrumentation")
  8. }
  9. dependencies {
  10. compileOnly("com.google.auto.value:auto-value-annotations")
  11. annotationProcessor("com.google.auto.value:auto-value")
  12. testImplementation(project(":instrumentation:jdbc:testing"))
  13. }
  14. tasks {
  15. shadowJar {
  16. dependencies {
  17. // including only current module excludes its transitive dependencies
  18. include(project(":instrumentation:jdbc:library"))
  19. }
  20. // rename classes that are included in :instrumentation:jdbc:bootstrap
  21. relocate("io.opentelemetry.instrumentation.jdbc.internal.dbinfo", "io.opentelemetry.javaagent.bootstrap.jdbc")
  22. }
  23. // this will be included in javaagent module
  24. val extractShadowJarJavaagent by registering(Copy::class) {
  25. dependsOn(shadowJar)
  26. from(zipTree(shadowJar.get().archiveFile))
  27. into("build/extracted/shadow-javaagent")
  28. exclude("META-INF/**")
  29. exclude("io/opentelemetry/javaagent/bootstrap/**")
  30. }
  31. // this will be included in bootstrap module
  32. val extractShadowJarBootstrap by registering(Copy::class) {
  33. dependsOn(shadowJar)
  34. from(zipTree(shadowJar.get().archiveFile))
  35. into("build/extracted/shadow-bootstrap")
  36. include("io/opentelemetry/javaagent/bootstrap/**")
  37. }
  38. }