Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 10 additions & 4 deletions sentry-android-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@ android {
}
}

tasks.withType<JavaCompile>().configureEach {
options.errorprone {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "io.sentry")
// net.ltgt.errorprone only configures Gradle's JVM source sets, not Android variants, so put Error
// Prone on each variant's processor path and enable it ourselves.
androidComponents.onVariants { variant ->
variant.annotationProcessorConfiguration.extendsFrom(configurations.errorprone.get())
variant.configureJavaCompileTask { task ->
task.options.errorprone {
enabled = true
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "io.sentry")
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,19 @@ dependencies {
androidTestImplementation(libs.okhttp.mockwebserver)
}

tasks.withType<JavaCompile>().configureEach {
options.errorprone {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "io.sentry")
option("NullAway:UnannotatedSubPackages", "io.sentry.uitest.android.databinding")
// net.ltgt.errorprone only configures Gradle's JVM source sets, not Android variants, so put Error
// Prone on each variant's processor path and enable it ourselves.
androidComponents.onVariants { variant ->
variant.annotationProcessorConfiguration.extendsFrom(configurations.errorprone.get())
variant.configureJavaCompileTask { task ->
task.options.errorprone {
enabled = true
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "io.sentry")
option("NullAway:UnannotatedSubPackages", "io.sentry.uitest.android.databinding")
// AGP generates the view binding classes, so their findings can't be fixed here.
excludedPaths.set(".*/build/generated/.*")
}
}
}

Expand Down
Loading