Move caffeine patching to instrumentation-api-caching (#3559)
This commit is contained in:
parent
8318d5acc9
commit
c1b5c0884d
|
|
@ -20,6 +20,11 @@ dependencies {
|
|||
shadowInclude("com.blogspot.mydailyjava:weak-lock-free")
|
||||
}
|
||||
|
||||
// patch inner class from Caffeine to avoid ForkJoinTask from being loaded too early in the javaagent
|
||||
val patch by sourceSets.creating {
|
||||
java {}
|
||||
}
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
configurations = listOf(shadowInclude)
|
||||
|
|
@ -32,7 +37,15 @@ tasks {
|
|||
|
||||
val extractShadowJar by registering(Copy::class) {
|
||||
dependsOn(shadowJar)
|
||||
from(zipTree(shadowJar.get().archiveFile))
|
||||
|
||||
// replace caffeine class with our patched version
|
||||
from(zipTree(shadowJar.get().archiveFile)) {
|
||||
exclude("io/opentelemetry/instrumentation/api/internal/shaded/caffeine/cache/BoundedLocalCache\$PerformCleanupTask.class")
|
||||
}
|
||||
from(patch.output) {
|
||||
include("io/opentelemetry/instrumentation/api/internal/shaded/caffeine/cache/BoundedLocalCache\$PerformCleanupTask.class")
|
||||
}
|
||||
|
||||
into("build/extracted/shadow")
|
||||
// prevents empty com/github/benmanes/caffeine/cache path from ending up in instrumentation-api
|
||||
includeEmptyDirs = false
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ dependencies {
|
|||
compileOnly("com.google.auto.value:auto-value-annotations")
|
||||
annotationProcessor("com.google.auto.value:auto-value")
|
||||
|
||||
testCompileOnly(project(":instrumentation-api-caching"))
|
||||
testImplementation(project(":testing-common"))
|
||||
testImplementation("org.mockito:mockito-core")
|
||||
testImplementation("org.mockito:mockito-junit-jupiter")
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
plugins {
|
||||
id("otel.java-conventions")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// For testing javaagent-bootstrap's Caffeine patch, we need to compile against our cache API
|
||||
// but make sure to run against javaagent-bootstrap
|
||||
testCompileOnly(project(":instrumentation-api-caching"))
|
||||
testRuntimeOnly(project(":javaagent-bootstrap"))
|
||||
|
||||
testImplementation("org.assertj:assertj-core")
|
||||
}
|
||||
|
|
@ -5,18 +5,6 @@ plugins {
|
|||
|
||||
group = "io.opentelemetry.javaagent"
|
||||
|
||||
// patch inner class from Caffeine to avoid ForkJoinTask from being loaded too early
|
||||
val patch = sourceSets.create("patch")
|
||||
patch.java {}
|
||||
|
||||
tasks {
|
||||
named<Jar>("jar") {
|
||||
from(patch.output) {
|
||||
include("io/opentelemetry/instrumentation/api/internal/shaded/caffeine/cache/BoundedLocalCache\$PerformCleanupTask.class")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api("io.opentelemetry:opentelemetry-api")
|
||||
api("io.opentelemetry:opentelemetry-api-metrics")
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ rootProject.name = "opentelemetry-java-instrumentation"
|
|||
include(":opentelemetry-api-shaded-for-instrumenting")
|
||||
include(":opentelemetry-ext-annotations-shaded-for-instrumenting")
|
||||
include(":javaagent-bootstrap")
|
||||
include(":javaagent-bootstrap-tests")
|
||||
include(":javaagent-exporters")
|
||||
include(":javaagent-extension-api")
|
||||
include(":javaagent-tooling")
|
||||
|
|
|
|||
Loading…
Reference in New Issue