Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
8925435
feat(spring): [Cache Tracing 1] Add SentryCacheWrapper and SentryCach…
adinauer Mar 2, 2026
6e4ede5
Merge branch 'main' into feat/cache-tracing-wrappers
adinauer Mar 5, 2026
7735a81
collection: Cache Tracing
adinauer Mar 5, 2026
6d6f5eb
Merge branch 'feat/cache-tracing' into feat/cache-tracing-wrappers
adinauer Mar 5, 2026
da5bde0
fix(cache): Fix span description, putIfAbsent, and Callable hit detec…
adinauer Mar 9, 2026
5e081fc
feat(core): [Cache Tracing 2] Add enableCacheTracing option
adinauer Mar 2, 2026
3815908
feat(spring): [Cache Tracing 3] Add BeanPostProcessor and auto-config…
adinauer Mar 2, 2026
84f4889
changelog
adinauer Mar 3, 2026
fc79424
fix: Update changelog PR references
adinauer Mar 9, 2026
ae0f569
feat(samples): [Cache Tracing 4] Add cache tracing e2e sample
adinauer Mar 5, 2026
cf3b325
ref(samples): Replace ConcurrentMapCacheManager with Caffeine
adinauer Mar 9, 2026
7c54933
fix dependencies; move to toml
adinauer Mar 9, 2026
ffb6ae4
Merge remote-tracking branch 'origin/main' into feat/cache-tracing
adinauer Mar 9, 2026
94ae0e1
Merge branch 'feat/cache-tracing' into feat/cache-tracing-wrappers
adinauer Mar 9, 2026
50c1206
Merge branch 'feat/cache-tracing-wrappers' into feat/cache-tracing-op…
adinauer Mar 9, 2026
6add6e1
Merge branch 'feat/cache-tracing-option' into feat/cache-tracing-auto…
adinauer Mar 9, 2026
1afb20e
Merge branch 'feat/cache-tracing-autoconfig' into feat/cache-tracing-…
adinauer Mar 9, 2026
6822d8a
feat(jcache): Add SentryJCacheWrapper for JCache (JSR-107) cache tracing
adinauer Mar 9, 2026
4b6759d
changelog
adinauer Mar 9, 2026
93be5c8
fix(jcache): Make replace and getAndReplace passthrough (no span)
adinauer Mar 10, 2026
038e792
fix(jcache): Check for NoOp span after startChild
adinauer Mar 10, 2026
0d4de4b
fix(jcache): Use cache.flush for removeAll() without keys
adinauer Mar 10, 2026
8434b4e
feat(samples): Add JCache cache tracing demo to console sample
adinauer Mar 10, 2026
8be4571
changelog
adinauer Mar 10, 2026
d55c8fa
Merge branch 'feat/cache-tracing-autoconfig' into feat/cache-tracing-…
adinauer Mar 10, 2026
ebb8ee1
Merge branch 'feat/cache-tracing-sample' into feat/cache-tracing-jcache
adinauer Mar 10, 2026
7453d68
changelog
adinauer Mar 10, 2026
5059f9a
Merge branch 'feat/cache-tracing-jcache' into feat/cache-tracing-cons…
adinauer Mar 10, 2026
89a572d
fix(core): Use correct cache span op terminology in Javadoc
adinauer Mar 10, 2026
70ea6d7
Merge branch 'feat/cache-tracing-option' into feat/cache-tracing-auto…
adinauer Mar 10, 2026
1484b6b
Merge branch 'feat/cache-tracing-autoconfig' into feat/cache-tracing-…
adinauer Mar 10, 2026
ba9add7
Merge branch 'feat/cache-tracing-sample' into feat/cache-tracing-jcache
adinauer Mar 10, 2026
b3c5751
Merge branch 'feat/cache-tracing-jcache' into feat/cache-tracing-cons…
adinauer Mar 10, 2026
c03021a
changelog
adinauer Mar 10, 2026
19eb28b
Merge branch 'feat/cache-tracing-autoconfig' into feat/cache-tracing-…
adinauer Mar 10, 2026
032ab26
changelog
adinauer Mar 10, 2026
96acd1d
Merge branch 'feat/cache-tracing-jcache' into feat/cache-tracing-cons…
adinauer Mar 10, 2026
0b1b83a
fix(spring7): Avoid double-wrapping caches in SentryCacheManagerWrapper
adinauer Mar 10, 2026
21f5b1e
Merge branch 'feat/cache-tracing-wrappers' into feat/cache-tracing-op…
adinauer Mar 10, 2026
8d588b2
Merge branch 'feat/cache-tracing-option' into feat/cache-tracing-auto…
adinauer Mar 10, 2026
d2c83ac
Merge branch 'feat/cache-tracing-autoconfig' into feat/cache-tracing-…
adinauer Mar 10, 2026
bbbb702
Merge branch 'feat/cache-tracing-sample' into feat/cache-tracing-jcache
adinauer Mar 10, 2026
a3b5eb4
Merge branch 'feat/cache-tracing-jcache' into feat/cache-tracing-cons…
adinauer Mar 10, 2026
76a2ecd
feat(samples): Add cache tracing to all Spring Boot 4 samples
adinauer Mar 10, 2026
d797a2d
fix(test): Add SENTRY_ENABLE_CACHE_TRACING env var to system test runner
adinauer Mar 10, 2026
dbb2998
feat(jcache): Add SentryJCacheWrapper ctor that uses ScopesAdapter
adinauer Mar 10, 2026
41872ad
feat(spring7): Add retrieve() overrides to SentryCacheWrapper
adinauer Mar 10, 2026
4d9f683
feat(spring-jakarta): Add cache tracing for Spring Boot 3 / Spring 6
adinauer Mar 13, 2026
658e082
feat(samples): Add cache tracing to all Spring Boot 3 Jakarta samples
adinauer Mar 13, 2026
7e66a3d
feat(spring): Add cache tracing for Spring Boot 2 / Spring 5
adinauer Mar 13, 2026
d5e58b0
feat(samples): Add cache tracing to Spring Boot 2 sample
adinauer Mar 13, 2026
7fa53f7
changelog
adinauer Mar 13, 2026
5a729ca
fix(spring): Skip cache span data when child span is NoOp
adinauer Mar 13, 2026
5d8a445
feat(spring): Add db.operation.name attribute to cache spans
adinauer Mar 17, 2026
b8911d9
feat(spring): Instrument putIfAbsent, replace, and getAndReplace cach…
adinauer Mar 17, 2026
2820549
fix(spring): Use ValueWrapper to determine cache hit in typed get
adinauer Mar 18, 2026
4b60cec
docs(jcache): Fix docs link in README
adinauer Mar 18, 2026
4e794ef
ref(spring): Use method-specific span operations for cache spans
adinauer Mar 18, 2026
0a32614
ref(spring): Derive span operation from operationName in startSpan
adinauer Mar 18, 2026
82bc35e
ref(jcache): Merge startSpanForKeys into startSpan overload
adinauer Mar 18, 2026
f1dd736
Format code
getsentry-bot Mar 18, 2026
bc93435
ref(cache): Move operation attribute to SpanDataConvention as CACHE_O…
adinauer Mar 18, 2026
7426ac7
feat(cache): Add cache.write boolean span attribute
adinauer Mar 18, 2026
867c67e
fix(jcache): Use comma-joined keys as span description for bulk opera…
adinauer Mar 18, 2026
518e465
ref(cache): Remove _KEY suffix from cache SpanDataConvention constants
adinauer Mar 18, 2026
83dfbfa
fix(spring): Fix get(key, type) double-call in SentryCacheWrapper
adinauer Mar 18, 2026
f9831a9
fix(samples): Fix cache evict system test to match actual span op
adinauer Mar 18, 2026
72a59c5
Merge pull request #5172 from getsentry/feat/cache-tracing-wrappers
adinauer Mar 23, 2026
10dacf9
Merge pull request #5173 from getsentry/feat/cache-tracing-option
adinauer Mar 23, 2026
2f4eb6b
Merge pull request #5174 from getsentry/feat/cache-tracing-autoconfig
adinauer Mar 23, 2026
4466961
Merge pull request #5175 from getsentry/feat/cache-tracing-sample
adinauer Mar 23, 2026
47a3b5c
Merge pull request #5179 from getsentry/feat/cache-tracing-jcache
adinauer Mar 23, 2026
df30083
Merge pull request #5182 from getsentry/feat/cache-tracing-console-sa…
adinauer Mar 23, 2026
a23a379
Merge pull request #5183 from getsentry/feat/cache-tracing-all-samples
adinauer Mar 23, 2026
9bc1f3a
assert multiple keys in single assertions
adinauer Mar 23, 2026
638152a
Format code
getsentry-bot Mar 23, 2026
43135e1
Merge branch 'feat/cache-tracing-jcache' into feat/cache-tracing
adinauer Mar 23, 2026
7381353
Merge branch 'feat/cache-tracing-console-sample' into feat/cache-tracing
adinauer Mar 23, 2026
69dad8a
Merge pull request #5184 from getsentry/feat/cache-tracing-retrieve
adinauer Mar 23, 2026
7d0ec4c
Merge pull request #5190 from getsentry/feat/cache-tracing-spring-boot-3
adinauer Mar 23, 2026
09e6e09
Merge pull request #5191 from getsentry/feat/cache-tracing-spring-boot-2
adinauer Mar 23, 2026
9348ff3
Merge pull request #5192 from getsentry/fix/cache-tracing-noop-span
adinauer Mar 23, 2026
8ceba9f
Merge pull request #5201 from getsentry/feat/cache-tracing-db-operati…
adinauer Mar 23, 2026
d6d5db5
Merge pull request #5202 from getsentry/feat/cache-tracing-instrument…
adinauer Mar 23, 2026
a06700e
Merge pull request #5203 from getsentry/fix/cache-tracing-typed-get-h…
adinauer Mar 23, 2026
cb8de20
Merge pull request #5204 from getsentry/ref/cache-tracing-method-spec…
adinauer Mar 23, 2026
49cd9b3
Merge branch 'feat/cache-tracing' into ref/cache-tracing-merge-starts…
adinauer Mar 23, 2026
590c86f
Merge pull request #5205 from getsentry/ref/cache-tracing-merge-start…
adinauer Mar 23, 2026
772b3f6
Merge pull request #5206 from getsentry/ref/cache-tracing-cache-opera…
adinauer Mar 23, 2026
557edb8
Merge pull request #5207 from getsentry/feat/cache-tracing-cache-write
adinauer Mar 23, 2026
c44ce1e
Merge pull request #5208 from getsentry/fix/cache-tracing-jcache-bulk…
adinauer Mar 23, 2026
fb25fd8
Merge pull request #5209 from getsentry/ref/cache-tracing-rename-cons…
adinauer Mar 23, 2026
36b3bf2
Merge pull request #5210 from getsentry/fix/cache-tracing-typed-get-d…
adinauer Mar 23, 2026
d7b3b0b
Merge pull request #5212 from getsentry/fix/cache-tracing-evict-syste…
adinauer Mar 23, 2026
3520857
Merge pull request #5228 from getsentry/feat/cache-tracing-more-revie…
adinauer Mar 23, 2026
3537d84
Merge branch 'main' into feat/cache-tracing
adinauer Mar 23, 2026
616aeab
update PR links in changelog
adinauer Mar 23, 2026
cf230cd
fix(spring): [Cache Tracing 24] Track invalidate cache.write accurately
adinauer Mar 25, 2026
21db8da
Merge pull request #5231 from getsentry/fix/cache-tracing-invalidate-…
adinauer Mar 25, 2026
43e78bb
Merge branch 'main' into feat/cache-tracing
adinauer Mar 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

### Features

- Add cache tracing instrumentation for Spring Boot 2, 3, and 4 ([#5165](https://github.com/getsentry/sentry-java/pull/5165))
- Wraps Spring `CacheManager` and `Cache` beans to produce cache spans
- Set `sentry.enable-cache-tracing` to `true` to enable this feature
- Add JCache (JSR-107) cache tracing via new `sentry-jcache` module ([#5165](https://github.com/getsentry/sentry-java/pull/5165))
- Wraps JCache `Cache` with `SentryJCacheWrapper` to produce cache spans
- Set the `enableCacheTracing` option to `true` to enable this feature
- 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))
- Android: Add `beforeErrorSampling` callback to Session Replay ([#5214](https://github.com/getsentry/sentry-java/pull/5214))
- Allows filtering which errors trigger replay capture before the `onErrorSampleRate` is checked
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Sentry SDK for Java and Android
| sentry-graphql | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-graphql?style=for-the-badge&logo=sentry&color=green) |
| 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) |
| 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) |
| sentry-jcache | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-jcache?style=for-the-badge&logo=sentry&color=green) |
| sentry-quartz | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-quartz?style=for-the-badge&logo=sentry&color=green) |
| sentry-openfeign | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-openfeign?style=for-the-badge&logo=sentry&color=green) |
| sentry-openfeature | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-openfeature?style=for-the-badge&logo=sentry&color=green) |
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ object Config {
val SENTRY_GRAPHQL_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.graphql"
val SENTRY_GRAPHQL_CORE_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.graphql-core"
val SENTRY_GRAPHQL22_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.graphql22"
val SENTRY_JCACHE_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.jcache"
val SENTRY_QUARTZ_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.quartz"
val SENTRY_JDBC_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.jdbc"
val SENTRY_OPENFEATURE_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.openfeature"
Expand Down
6 changes: 6 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version
androidx-browser = { module = "androidx.browser:browser", version = "1.8.0" }
async-profiler = { module = "tools.profiler:async-profiler", version.ref = "asyncProfiler" }
async-profiler-jfr-converter = { module = "tools.profiler:jfr-converter", version.ref = "asyncProfiler" }
caffeine = { module = "com.github.ben-manes.caffeine:caffeine" }
caffeine-jcache = { module = "com.github.ben-manes.caffeine:jcache", version = "3.2.0" }
coil-compose = { module = "io.coil-kt:coil-compose", version = "2.6.0" }
commons-compress = {module = "org.apache.commons:commons-compress", version = "1.25.0"}
context-propagation = { module = "io.micrometer:context-propagation", version = "1.1.0" }
Expand Down Expand Up @@ -144,6 +146,7 @@ otel-semconv = { module = "io.opentelemetry.semconv:opentelemetry-semconv", vers
otel-semconv-incubating = { module = "io.opentelemetry.semconv:opentelemetry-semconv-incubating", version.ref = "otelSemanticConventionsAlpha" }
p6spy = { module = "p6spy:p6spy", version = "3.9.1" }
epitaph = { module = "com.abovevacant:epitaph", version = "0.1.1" }
jcache = { module = "javax.cache:cache-api", version = "1.1.1" }
quartz = { module = "org.quartz-scheduler:quartz", version = "2.3.0" }
reactor-core = { module = "io.projectreactor:reactor-core", version = "3.5.3" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
Expand All @@ -166,6 +169,7 @@ springboot-starter-aop = { module = "org.springframework.boot:spring-boot-starte
springboot-starter-security = { module = "org.springframework.boot:spring-boot-starter-security", version.ref = "springboot2" }
springboot-starter-jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc", version.ref = "springboot2" }
springboot-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot2" }
springboot-starter-cache = { module = "org.springframework.boot:spring-boot-starter-cache", version.ref = "springboot2" }
springboot3-otel = { module = "io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter", version.ref = "otelInstrumentation" }
springboot3-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "springboot3" }
springboot3-starter-graphql = { module = "org.springframework.boot:spring-boot-starter-graphql", version.ref = "springboot3" }
Expand All @@ -178,6 +182,7 @@ springboot3-starter-aop = { module = "org.springframework.boot:spring-boot-start
springboot3-starter-security = { module = "org.springframework.boot:spring-boot-starter-security", version.ref = "springboot3" }
springboot3-starter-jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc", version.ref = "springboot3" }
springboot3-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot3" }
springboot3-starter-cache = { module = "org.springframework.boot:spring-boot-starter-cache", version.ref = "springboot3" }
springboot4-otel = { module = "io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter", version.ref = "otelInstrumentation" }
springboot4-resttestclient = { module = "org.springframework.boot:spring-boot-resttestclient", version.ref = "springboot4" }
springboot4-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "springboot4" }
Expand All @@ -193,6 +198,7 @@ springboot4-starter-restclient = { module = "org.springframework.boot:spring-boo
springboot4-starter-webclient = { module = "org.springframework.boot:spring-boot-starter-webclient", version.ref = "springboot4" }
springboot4-starter-jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc", version.ref = "springboot4" }
springboot4-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot4" }
springboot4-starter-cache = { module = "org.springframework.boot:spring-boot-starter-cache", version.ref = "springboot4" }
timber = { module = "com.jakewharton.timber:timber", version = "4.7.1" }

# Animalsniffer signature
Expand Down
13 changes: 13 additions & 0 deletions sentry-jcache/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# sentry-jcache

This module provides an integration for JCache (JSR-107).

JCache is a standard API — you need a provider implementation at runtime. Common implementations include:

- [Caffeine](https://github.com/ben-manes/caffeine) (via `com.github.ben-manes.caffeine:jcache`)
- [Ehcache 3](https://www.ehcache.org/) (via `org.ehcache:ehcache`)
- [Hazelcast](https://hazelcast.com/)
- [Apache Ignite](https://ignite.apache.org/)
- [Infinispan](https://infinispan.org/)

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/).
38 changes: 38 additions & 0 deletions sentry-jcache/api/sentry-jcache.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
public final class io/sentry/jcache/BuildConfig {
public static final field SENTRY_JCACHE_SDK_NAME Ljava/lang/String;
public static final field VERSION_NAME Ljava/lang/String;
}

public final class io/sentry/jcache/SentryJCacheWrapper : javax/cache/Cache {
public fun <init> (Ljavax/cache/Cache;)V
public fun <init> (Ljavax/cache/Cache;Lio/sentry/IScopes;)V
public fun clear ()V
public fun close ()V
public fun containsKey (Ljava/lang/Object;)Z
public fun deregisterCacheEntryListener (Ljavax/cache/configuration/CacheEntryListenerConfiguration;)V
public fun get (Ljava/lang/Object;)Ljava/lang/Object;
public fun getAll (Ljava/util/Set;)Ljava/util/Map;
public fun getAndPut (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
public fun getAndRemove (Ljava/lang/Object;)Ljava/lang/Object;
public fun getAndReplace (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
public fun getCacheManager ()Ljavax/cache/CacheManager;
public fun getConfiguration (Ljava/lang/Class;)Ljavax/cache/configuration/Configuration;
public fun getName ()Ljava/lang/String;
public fun invoke (Ljava/lang/Object;Ljavax/cache/processor/EntryProcessor;[Ljava/lang/Object;)Ljava/lang/Object;
public fun invokeAll (Ljava/util/Set;Ljavax/cache/processor/EntryProcessor;[Ljava/lang/Object;)Ljava/util/Map;
public fun isClosed ()Z
public fun iterator ()Ljava/util/Iterator;
public fun loadAll (Ljava/util/Set;ZLjavax/cache/integration/CompletionListener;)V
public fun put (Ljava/lang/Object;Ljava/lang/Object;)V
public fun putAll (Ljava/util/Map;)V
public fun putIfAbsent (Ljava/lang/Object;Ljava/lang/Object;)Z
public fun registerCacheEntryListener (Ljavax/cache/configuration/CacheEntryListenerConfiguration;)V
public fun remove (Ljava/lang/Object;)Z
public fun remove (Ljava/lang/Object;Ljava/lang/Object;)Z
public fun removeAll ()V
public fun removeAll (Ljava/util/Set;)V
public fun replace (Ljava/lang/Object;Ljava/lang/Object;)Z
public fun replace (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z
public fun unwrap (Ljava/lang/Class;)Ljava/lang/Object;
}

90 changes: 90 additions & 0 deletions sentry-jcache/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import net.ltgt.gradle.errorprone.errorprone
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`java-library`
id("io.sentry.javadoc")
alias(libs.plugins.kotlin.jvm)
jacoco
alias(libs.plugins.errorprone)
alias(libs.plugins.gradle.versions)
alias(libs.plugins.buildconfig)
}

tasks.withType<KotlinCompile>().configureEach {
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
}

dependencies {
api(projects.sentry)
compileOnly(libs.jcache)

compileOnly(libs.jetbrains.annotations)
compileOnly(libs.nopen.annotations)
errorprone(libs.errorprone.core)
errorprone(libs.nopen.checker)
errorprone(libs.nullaway)

// tests
testImplementation(projects.sentry)
testImplementation(projects.sentryTestSupport)
testImplementation(libs.jcache)
testImplementation(kotlin(Config.kotlinStdLib))
testImplementation(libs.kotlin.test.junit)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.mockito.inline)
}

configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }

jacoco { toolVersion = libs.versions.jacoco.get() }

tasks.jacocoTestReport {
reports {
xml.required.set(true)
html.required.set(false)
}
}

tasks {
jacocoTestCoverageVerification {
violationRules { rule { limit { minimum = Config.QualityPlugins.Jacoco.minimumCoverage } } }
}
check {
dependsOn(jacocoTestCoverageVerification)
dependsOn(jacocoTestReport)
}
}

tasks.withType<JavaCompile>().configureEach {
options.errorprone {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "io.sentry")
}
}

buildConfig {
useJavaOutput()
packageName("io.sentry.jcache")
buildConfigField(
"String",
"SENTRY_JCACHE_SDK_NAME",
"\"${Config.Sentry.SENTRY_JCACHE_SDK_NAME}\"",
)
buildConfigField("String", "VERSION_NAME", "\"${project.version}\"")
}

tasks.jar {
manifest {
attributes(
"Sentry-Version-Name" to project.version,
"Sentry-SDK-Name" to Config.Sentry.SENTRY_JCACHE_SDK_NAME,
"Sentry-SDK-Package-Name" to "maven:io.sentry:sentry-jcache",
"Implementation-Vendor" to "Sentry",
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
)
}
}
Loading
Loading