1import net.ltgt.gradle.errorprone.CheckSeverity
2
3plugins {
4    id 'net.ltgt.errorprone'
5    id 'net.ltgt.nullaway'
6}
7
8tasks.withType(JavaCompile).configureEach {
9    options.compilerArgs += ["-Xmaxerrs", "10000"] // Display all errors
10    if (name.contains("Nullsafe")) {
11        options.errorprone.disableAllChecks = true
12        options.errorprone.nullaway {
13            severity = CheckSeverity.ERROR
14
15            // Control the packages and classes that are treated as annotated
16            annotatedPackages.add("com.android.systemui.qs")
17
18            // Ignore Dagger-generated classes
19            excludedClassAnnotations.add("dagger.internal.DaggerGenerated")
20        }
21    } else {
22        options.errorprone.enabled = false
23    }
24}
25
26dependencies {
27    annotationProcessor "com.uber.nullaway:nullaway:0.9.1"
28    annotationProcessor "com.google.errorprone:error_prone_core:2.4.0"
29}
30