Skip to content

Commit 028aa67

Browse files
adinauerclaudegetsentry-bot
authored
feat(spring): Cache Tracing (#5165)
* feat(spring): [Cache Tracing 1] Add SentryCacheWrapper and SentryCacheManagerWrapper Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * collection: Cache Tracing * fix(cache): Fix span description, putIfAbsent, and Callable hit detection - Use cache key as span description instead of cache name, matching the spec and other SDKs (Python, JavaScript) - Skip instrumentation for putIfAbsent since we cannot know if a write actually occurred; override to bypass default get()+put() delegation - Wrap valueLoader Callable in get(key, Callable) to detect cache hit/miss instead of always reporting hit=true - Update tests to match new behavior Co-Authored-By: Claude <noreply@anthropic.com> * feat(core): [Cache Tracing 2] Add enableCacheTracing option Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(spring): [Cache Tracing 3] Add BeanPostProcessor and auto-configuration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * changelog * fix: Update changelog PR references Co-Authored-By: Claude <noreply@anthropic.com> * feat(samples): [Cache Tracing 4] Add cache tracing e2e sample Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ref(samples): Replace ConcurrentMapCacheManager with Caffeine Use Caffeine as the cache provider instead of a plain ConcurrentMapCacheManager. Spring Boot auto-configures CaffeineCacheManager when Caffeine is on the classpath, so the explicit CacheManager bean is no longer needed. Co-Authored-By: Claude <noreply@anthropic.com> * fix dependencies; move to toml * feat(jcache): Add SentryJCacheWrapper for JCache (JSR-107) cache tracing * changelog * fix(jcache): Make replace and getAndReplace passthrough (no span) Like putIfAbsent, these are conditional writes that may be no-ops. Emitting a cache.put span for them would be misleading. * fix(jcache): Check for NoOp span after startChild startChild can return a NoOp span (e.g. when span limit is reached). Skip instrumentation in that case to avoid unnecessary work. * fix(jcache): Use cache.flush for removeAll() without keys removeAll() with no args removes all entries, which is semantically equivalent to clear(). Use cache.flush instead of cache.remove. The keyed removeAll(Set) remains cache.remove. * feat(samples): Add JCache cache tracing demo to console sample Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * changelog Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * changelog Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(core): Use correct cache span op terminology in Javadoc Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * changelog * fix(spring7): Avoid double-wrapping caches in SentryCacheManagerWrapper Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(samples): Add cache tracing to all Spring Boot 4 samples Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(test): Add SENTRY_ENABLE_CACHE_TRACING env var to system test runner Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(jcache): Add SentryJCacheWrapper ctor that uses ScopesAdapter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(spring7): Add retrieve() overrides to SentryCacheWrapper Adds support for Spring 6.1+ async cache operations (CompletableFuture and Mono/Flux). Without these overrides, @Cacheable on reactive return types crashes with UnsupportedOperationException. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(spring-jakarta): Add cache tracing for Spring Boot 3 / Spring 6 Port cache tracing classes from sentry-spring-7 to sentry-spring-jakarta, covering Spring Boot 3 (Spring Framework 6.x) users. Includes SentryCacheWrapper, SentryCacheManagerWrapper, SentryCacheBeanPostProcessor, and auto-configuration in sentry-spring-boot-jakarta. The retrieve() overrides for CompletableFuture/reactive cache operations are included and safe on Spring 6.0 (where retrieve() doesn't exist on the Cache interface) — they're simply dead code, never called by the framework until Spring 6.1+. Co-Authored-By: Claude <noreply@anthropic.com> * feat(samples): Add cache tracing to all Spring Boot 3 Jakarta samples Add CacheController, TodoService with @Cacheable/@CachePut/@CacheEvict, Caffeine cache config, and CacheSystemTest e2e tests to all four Jakarta sample modules: - sentry-samples-spring-boot-jakarta - sentry-samples-spring-boot-jakarta-opentelemetry - sentry-samples-spring-boot-jakarta-opentelemetry-noagent - sentry-samples-spring-boot-webflux-jakarta Co-Authored-By: Claude <noreply@anthropic.com> * feat(spring): Add cache tracing for Spring Boot 2 / Spring 5 Port cache tracing instrumentation from sentry-spring-jakarta to sentry-spring for Spring Boot 2 users. Adds SentryCacheWrapper, SentryCacheManagerWrapper, and SentryCacheBeanPostProcessor in the io.sentry.spring.cache package. Wires auto-configuration in sentry-spring-boot via sentry.enable-cache-tracing=true property. The retrieve() methods are omitted since Spring 5 does not have them (they were added in Spring 6.1). Co-Authored-By: Claude <noreply@anthropic.com> * feat(samples): Add cache tracing to Spring Boot 2 sample Add CacheController, TodoService with @Cacheable/@CachePut/@CacheEvict annotations, and CacheSystemTest e2e tests to the sentry-samples-spring-boot sample. Enables cache tracing with Caffeine as the cache provider. Co-Authored-By: Claude <noreply@anthropic.com> * changelog * fix(spring): Skip cache span data when child span is NoOp Add span.isNoOp() check after startChild() in all three Spring SentryCacheWrapper variants, matching the existing pattern in SentryJCacheWrapper. This avoids setting span data on noop spans when sampling drops the span. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(spring): Add db.operation.name attribute to cache spans Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(spring): Instrument putIfAbsent, replace, and getAndReplace cache operations Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(spring): Use ValueWrapper to determine cache hit in typed get The get(key, type) method incorrectly used result != null to detect cache hits, failing to distinguish a miss from a cached null value. Now uses delegate.get(key) to check the ValueWrapper first. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs(jcache): Fix docs link in README Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ref(spring): Use method-specific span operations for cache spans Instead of the 4 generic categories (cache.get, cache.put, cache.remove, cache.flush), use the actual method name as the span operation (e.g. cache.evict, cache.putIfAbsent, cache.retrieve). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ref(spring): Derive span operation from operationName in startSpan Remove redundant first parameter since it was always "cache." + operationName. The prefix is now applied inside the helper method. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ref(jcache): Merge startSpanForKeys into startSpan overload Replace the separate startSpanForKeys helper with a startSpan(Set, String) overload, unifying the two span creation methods under the same name. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Format code * ref(cache): Move operation attribute to SpanDataConvention as CACHE_OPERATION_KEY Replace local OPERATION_ATTRIBUTE constants in all cache wrappers with a shared CACHE_OPERATION_KEY constant in SpanDataConvention. Also changes the attribute key from "db.operation.name" to "cache.operation". * feat(cache): Add cache.write boolean span attribute Set cache.write on spans across all four cache wrapper implementations to indicate whether an operation actually modified the cache. This complements the existing cache.hit attribute for read operations. Co-Authored-By: Claude <noreply@anthropic.com> * fix(jcache): Use comma-joined keys as span description for bulk operations Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ref(cache): Remove _KEY suffix from cache SpanDataConvention constants Rename CACHE_HIT_KEY, CACHE_KEY_KEY, and CACHE_OPERATION_KEY to CACHE_HIT, CACHE_KEY, and CACHE_OPERATION to match the newer naming convention used by CACHE_WRITE, THREAD_ID, FRAMES_TOTAL, etc. Co-Authored-By: Claude <noreply@anthropic.com> * fix(spring): Fix get(key, type) double-call in SentryCacheWrapper Use a single delegate.get(key, type) call instead of calling delegate.get(key) for hit detection and delegate.get(key, type) for the actual value. This eliminates doubled cache round trips (e.g. Redis network calls) and a TOCTOU race where the entry could expire between the two calls. The trade-off is that cached null values are now indistinguishable from cache misses, which is acceptable for observability purposes. * fix(samples): Fix cache evict system test to match actual span op * assert multiple keys in single assertions * Format code * update PR links in changelog * fix(spring): [Cache Tracing 24] Track invalidate cache.write accurately Set cache.write based on delegate.invalidate() result instead of always true. This keeps span data aligned with Spring's invalidate semantics when no entries were present. Add tests in spring, spring-jakarta, and spring-7 wrappers to cover the false return path and assert cache.write is false. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
1 parent 23b2680 commit 028aa67

File tree

100 files changed

+5447
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+5447
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
### Features
1010

11+
- Add cache tracing instrumentation for Spring Boot 2, 3, and 4 ([#5165](https://github.com/getsentry/sentry-java/pull/5165))
12+
- Wraps Spring `CacheManager` and `Cache` beans to produce cache spans
13+
- Set `sentry.enable-cache-tracing` to `true` to enable this feature
14+
- Add JCache (JSR-107) cache tracing via new `sentry-jcache` module ([#5165](https://github.com/getsentry/sentry-java/pull/5165))
15+
- Wraps JCache `Cache` with `SentryJCacheWrapper` to produce cache spans
16+
- Set the `enableCacheTracing` option to `true` to enable this feature
1117
- Add configurable `IScopesStorageFactory` to `SentryOptions` for providing a custom `IScopesStorage`, e.g. when the default `ThreadLocal`-backed storage is incompatible with non-pinning thread models ([#5199](https://github.com/getsentry/sentry-java/pull/5199))
1218
- Android: Add `beforeErrorSampling` callback to Session Replay ([#5214](https://github.com/getsentry/sentry-java/pull/5214))
1319
- Allows filtering which errors trigger replay capture before the `onErrorSampleRate` is checked

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Sentry SDK for Java and Android
5757
| sentry-graphql | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-graphql?style=for-the-badge&logo=sentry&color=green) |
5858
| sentry-graphql-core | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-graphql-core?style=for-the-badge&logo=sentry&color=green) |
5959
| sentry-graphql-22 | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-graphql-22?style=for-the-badge&logo=sentry&color=green) |
60+
| sentry-jcache | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-jcache?style=for-the-badge&logo=sentry&color=green) |
6061
| sentry-quartz | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-quartz?style=for-the-badge&logo=sentry&color=green) |
6162
| sentry-openfeign | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-openfeign?style=for-the-badge&logo=sentry&color=green) |
6263
| sentry-openfeature | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-openfeature?style=for-the-badge&logo=sentry&color=green) |

buildSrc/src/main/java/Config.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ object Config {
7777
val SENTRY_GRAPHQL_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.graphql"
7878
val SENTRY_GRAPHQL_CORE_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.graphql-core"
7979
val SENTRY_GRAPHQL22_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.graphql22"
80+
val SENTRY_JCACHE_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.jcache"
8081
val SENTRY_QUARTZ_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.quartz"
8182
val SENTRY_JDBC_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.jdbc"
8283
val SENTRY_OPENFEATURE_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.openfeature"

gradle/libs.versions.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version
9999
androidx-browser = { module = "androidx.browser:browser", version = "1.8.0" }
100100
async-profiler = { module = "tools.profiler:async-profiler", version.ref = "asyncProfiler" }
101101
async-profiler-jfr-converter = { module = "tools.profiler:jfr-converter", version.ref = "asyncProfiler" }
102+
caffeine = { module = "com.github.ben-manes.caffeine:caffeine" }
103+
caffeine-jcache = { module = "com.github.ben-manes.caffeine:jcache", version = "3.2.0" }
102104
coil-compose = { module = "io.coil-kt:coil-compose", version = "2.6.0" }
103105
commons-compress = {module = "org.apache.commons:commons-compress", version = "1.25.0"}
104106
context-propagation = { module = "io.micrometer:context-propagation", version = "1.1.0" }
@@ -144,6 +146,7 @@ otel-semconv = { module = "io.opentelemetry.semconv:opentelemetry-semconv", vers
144146
otel-semconv-incubating = { module = "io.opentelemetry.semconv:opentelemetry-semconv-incubating", version.ref = "otelSemanticConventionsAlpha" }
145147
p6spy = { module = "p6spy:p6spy", version = "3.9.1" }
146148
epitaph = { module = "com.abovevacant:epitaph", version = "0.1.1" }
149+
jcache = { module = "javax.cache:cache-api", version = "1.1.1" }
147150
quartz = { module = "org.quartz-scheduler:quartz", version = "2.3.0" }
148151
reactor-core = { module = "io.projectreactor:reactor-core", version = "3.5.3" }
149152
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
@@ -166,6 +169,7 @@ springboot-starter-aop = { module = "org.springframework.boot:spring-boot-starte
166169
springboot-starter-security = { module = "org.springframework.boot:spring-boot-starter-security", version.ref = "springboot2" }
167170
springboot-starter-jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc", version.ref = "springboot2" }
168171
springboot-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot2" }
172+
springboot-starter-cache = { module = "org.springframework.boot:spring-boot-starter-cache", version.ref = "springboot2" }
169173
springboot3-otel = { module = "io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter", version.ref = "otelInstrumentation" }
170174
springboot3-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "springboot3" }
171175
springboot3-starter-graphql = { module = "org.springframework.boot:spring-boot-starter-graphql", version.ref = "springboot3" }
@@ -178,6 +182,7 @@ springboot3-starter-aop = { module = "org.springframework.boot:spring-boot-start
178182
springboot3-starter-security = { module = "org.springframework.boot:spring-boot-starter-security", version.ref = "springboot3" }
179183
springboot3-starter-jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc", version.ref = "springboot3" }
180184
springboot3-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot3" }
185+
springboot3-starter-cache = { module = "org.springframework.boot:spring-boot-starter-cache", version.ref = "springboot3" }
181186
springboot4-otel = { module = "io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter", version.ref = "otelInstrumentation" }
182187
springboot4-resttestclient = { module = "org.springframework.boot:spring-boot-resttestclient", version.ref = "springboot4" }
183188
springboot4-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "springboot4" }
@@ -193,6 +198,7 @@ springboot4-starter-restclient = { module = "org.springframework.boot:spring-boo
193198
springboot4-starter-webclient = { module = "org.springframework.boot:spring-boot-starter-webclient", version.ref = "springboot4" }
194199
springboot4-starter-jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc", version.ref = "springboot4" }
195200
springboot4-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot4" }
201+
springboot4-starter-cache = { module = "org.springframework.boot:spring-boot-starter-cache", version.ref = "springboot4" }
196202
timber = { module = "com.jakewharton.timber:timber", version = "4.7.1" }
197203

198204
# Animalsniffer signature

sentry-jcache/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# sentry-jcache
2+
3+
This module provides an integration for JCache (JSR-107).
4+
5+
JCache is a standard API — you need a provider implementation at runtime. Common implementations include:
6+
7+
- [Caffeine](https://github.com/ben-manes/caffeine) (via `com.github.ben-manes.caffeine:jcache`)
8+
- [Ehcache 3](https://www.ehcache.org/) (via `org.ehcache:ehcache`)
9+
- [Hazelcast](https://hazelcast.com/)
10+
- [Apache Ignite](https://ignite.apache.org/)
11+
- [Infinispan](https://infinispan.org/)
12+
13+
Please consult the documentation on how to install and use this integration in the Sentry Docs for [Java](https://docs.sentry.io/platforms/java/integrations/jcache/).
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
public final class io/sentry/jcache/BuildConfig {
2+
public static final field SENTRY_JCACHE_SDK_NAME Ljava/lang/String;
3+
public static final field VERSION_NAME Ljava/lang/String;
4+
}
5+
6+
public final class io/sentry/jcache/SentryJCacheWrapper : javax/cache/Cache {
7+
public fun <init> (Ljavax/cache/Cache;)V
8+
public fun <init> (Ljavax/cache/Cache;Lio/sentry/IScopes;)V
9+
public fun clear ()V
10+
public fun close ()V
11+
public fun containsKey (Ljava/lang/Object;)Z
12+
public fun deregisterCacheEntryListener (Ljavax/cache/configuration/CacheEntryListenerConfiguration;)V
13+
public fun get (Ljava/lang/Object;)Ljava/lang/Object;
14+
public fun getAll (Ljava/util/Set;)Ljava/util/Map;
15+
public fun getAndPut (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
16+
public fun getAndRemove (Ljava/lang/Object;)Ljava/lang/Object;
17+
public fun getAndReplace (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
18+
public fun getCacheManager ()Ljavax/cache/CacheManager;
19+
public fun getConfiguration (Ljava/lang/Class;)Ljavax/cache/configuration/Configuration;
20+
public fun getName ()Ljava/lang/String;
21+
public fun invoke (Ljava/lang/Object;Ljavax/cache/processor/EntryProcessor;[Ljava/lang/Object;)Ljava/lang/Object;
22+
public fun invokeAll (Ljava/util/Set;Ljavax/cache/processor/EntryProcessor;[Ljava/lang/Object;)Ljava/util/Map;
23+
public fun isClosed ()Z
24+
public fun iterator ()Ljava/util/Iterator;
25+
public fun loadAll (Ljava/util/Set;ZLjavax/cache/integration/CompletionListener;)V
26+
public fun put (Ljava/lang/Object;Ljava/lang/Object;)V
27+
public fun putAll (Ljava/util/Map;)V
28+
public fun putIfAbsent (Ljava/lang/Object;Ljava/lang/Object;)Z
29+
public fun registerCacheEntryListener (Ljavax/cache/configuration/CacheEntryListenerConfiguration;)V
30+
public fun remove (Ljava/lang/Object;)Z
31+
public fun remove (Ljava/lang/Object;Ljava/lang/Object;)Z
32+
public fun removeAll ()V
33+
public fun removeAll (Ljava/util/Set;)V
34+
public fun replace (Ljava/lang/Object;Ljava/lang/Object;)Z
35+
public fun replace (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z
36+
public fun unwrap (Ljava/lang/Class;)Ljava/lang/Object;
37+
}
38+

sentry-jcache/build.gradle.kts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import net.ltgt.gradle.errorprone.errorprone
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
4+
plugins {
5+
`java-library`
6+
id("io.sentry.javadoc")
7+
alias(libs.plugins.kotlin.jvm)
8+
jacoco
9+
alias(libs.plugins.errorprone)
10+
alias(libs.plugins.gradle.versions)
11+
alias(libs.plugins.buildconfig)
12+
}
13+
14+
tasks.withType<KotlinCompile>().configureEach {
15+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
16+
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
17+
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
18+
}
19+
20+
dependencies {
21+
api(projects.sentry)
22+
compileOnly(libs.jcache)
23+
24+
compileOnly(libs.jetbrains.annotations)
25+
compileOnly(libs.nopen.annotations)
26+
errorprone(libs.errorprone.core)
27+
errorprone(libs.nopen.checker)
28+
errorprone(libs.nullaway)
29+
30+
// tests
31+
testImplementation(projects.sentry)
32+
testImplementation(projects.sentryTestSupport)
33+
testImplementation(libs.jcache)
34+
testImplementation(kotlin(Config.kotlinStdLib))
35+
testImplementation(libs.kotlin.test.junit)
36+
testImplementation(libs.mockito.kotlin)
37+
testImplementation(libs.mockito.inline)
38+
}
39+
40+
configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }
41+
42+
jacoco { toolVersion = libs.versions.jacoco.get() }
43+
44+
tasks.jacocoTestReport {
45+
reports {
46+
xml.required.set(true)
47+
html.required.set(false)
48+
}
49+
}
50+
51+
tasks {
52+
jacocoTestCoverageVerification {
53+
violationRules { rule { limit { minimum = Config.QualityPlugins.Jacoco.minimumCoverage } } }
54+
}
55+
check {
56+
dependsOn(jacocoTestCoverageVerification)
57+
dependsOn(jacocoTestReport)
58+
}
59+
}
60+
61+
tasks.withType<JavaCompile>().configureEach {
62+
options.errorprone {
63+
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
64+
option("NullAway:AnnotatedPackages", "io.sentry")
65+
}
66+
}
67+
68+
buildConfig {
69+
useJavaOutput()
70+
packageName("io.sentry.jcache")
71+
buildConfigField(
72+
"String",
73+
"SENTRY_JCACHE_SDK_NAME",
74+
"\"${Config.Sentry.SENTRY_JCACHE_SDK_NAME}\"",
75+
)
76+
buildConfigField("String", "VERSION_NAME", "\"${project.version}\"")
77+
}
78+
79+
tasks.jar {
80+
manifest {
81+
attributes(
82+
"Sentry-Version-Name" to project.version,
83+
"Sentry-SDK-Name" to Config.Sentry.SENTRY_JCACHE_SDK_NAME,
84+
"Sentry-SDK-Package-Name" to "maven:io.sentry:sentry-jcache",
85+
"Implementation-Vendor" to "Sentry",
86+
"Implementation-Title" to project.name,
87+
"Implementation-Version" to project.version,
88+
)
89+
}
90+
}

0 commit comments

Comments
 (0)