Skip to content

Commit

Permalink
Don't include caffeine3 in instrumentation-api (#4466)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored and trask committed Oct 27, 2021
1 parent 9ac9dd0 commit 15ad905
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 deletions.
3 changes: 0 additions & 3 deletions instrumentation-api-caching/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ sourceSets {
main {
val caffeine2ShadedDeps = project(":instrumentation-api-caching:caffeine2")
output.dir(caffeine2ShadedDeps.file("build/extracted/shadow"), "builtBy" to ":instrumentation-api-caching:caffeine2:extractShadowJar")

val caffeine3ShadedDeps = project(":instrumentation-api-caching:caffeine3")
output.dir(caffeine3ShadedDeps.file("build/extracted/shadow"), "builtBy" to ":instrumentation-api-caching:caffeine3:extractShadowJar")
}
}

Expand Down
17 changes: 0 additions & 17 deletions instrumentation-api-caching/caffeine3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,4 @@ tasks {
javadoc {
enabled = false
}

val extractShadowJar by registering(Copy::class) {
dependsOn(shadowJar)

// replace caffeine class with our patched version
from(zipTree(shadowJar.get().archiveFile)) {
exclude("io/opentelemetry/instrumentation/api/internal/shaded/caffeine3/cache/BoundedLocalCache\$PerformCleanupTask.class")
exclude("META-INF/**")
}
from(patch.output) {
include("io/opentelemetry/instrumentation/api/internal/shaded/caffeine3/cache/BoundedLocalCache\$PerformCleanupTask.class")
}

into("build/extracted/shadow")
// prevents empty com/github/benmanes/caffeine/cache path from ending up in instrumentation-api
includeEmptyDirs = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static boolean available() {
try {
Caffeine.class.getName();
return true;
} catch (UnsupportedClassVersionError exception) {
} catch (UnsupportedClassVersionError | NoClassDefFoundError exception) {
// caffeine 3 requires jdk 11
return false;
}
Expand Down
1 change: 1 addition & 0 deletions javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ val licenseReportDependencies by configurations.creating {
dependencies {
bootstrapLibs(project(":instrumentation-api"))
bootstrapLibs(project(":instrumentation-api-annotation-support"))
bootstrapLibs(project(":instrumentation-api-caching:caffeine3", configuration = "shadow"))
bootstrapLibs(project(":javaagent-bootstrap"))
bootstrapLibs(project(":javaagent-instrumentation-api"))
bootstrapLibs("org.slf4j:slf4j-simple")
Expand Down

0 comments on commit 15ad905

Please sign in to comment.