build.gradle.kts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. plugins {
  2. id("com.github.johnrengelman.shadow")
  3. id("otel.java-conventions")
  4. }
  5. sourceSets {
  6. main {
  7. val caffeine2ShadedDeps = project(":instrumentation-api-caching:caffeine2")
  8. output.dir(caffeine2ShadedDeps.file("build/extracted/shadow"), "builtBy" to ":instrumentation-api-caching:caffeine2:extractShadowJar")
  9. val caffeine3ShadedDeps = project(":instrumentation-api-caching:caffeine3")
  10. output.dir(caffeine3ShadedDeps.file("build/extracted/shadow"), "builtBy" to ":instrumentation-api-caching:caffeine3:extractShadowJar")
  11. }
  12. }
  13. val shadowInclude by configurations.creating {
  14. isCanBeResolved = true
  15. isCanBeConsumed = false
  16. }
  17. dependencies {
  18. implementation("com.google.code.findbugs:jsr305:3.0.2")
  19. compileOnly(project(":instrumentation-api-caching:caffeine2", configuration = "shadow"))
  20. compileOnly(project(":instrumentation-api-caching:caffeine3", configuration = "shadow"))
  21. compileOnly("com.blogspot.mydailyjava:weak-lock-free")
  22. shadowInclude("com.blogspot.mydailyjava:weak-lock-free")
  23. }
  24. tasks {
  25. shadowJar {
  26. configurations = listOf(shadowInclude)
  27. relocate("com.blogspot.mydailyjava.weaklockfree", "io.opentelemetry.instrumentation.api.internal.shaded.weaklockfree")
  28. }
  29. val extractShadowJar by registering(Copy::class) {
  30. dependsOn(shadowJar)
  31. from(zipTree(shadowJar.get().archiveFile)) {
  32. exclude("META-INF/**")
  33. }
  34. into("build/extracted/shadow")
  35. }
  36. }