1*f50c3066SAndroid Build Coastguard Worker/* 2*f50c3066SAndroid Build Coastguard Worker * Copyright (C) 2017. Uber Technologies 3*f50c3066SAndroid Build Coastguard Worker * 4*f50c3066SAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*f50c3066SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*f50c3066SAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*f50c3066SAndroid Build Coastguard Worker * 8*f50c3066SAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*f50c3066SAndroid Build Coastguard Worker * 10*f50c3066SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*f50c3066SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*f50c3066SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*f50c3066SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*f50c3066SAndroid Build Coastguard Worker * limitations under the License. 15*f50c3066SAndroid Build Coastguard Worker */ 16*f50c3066SAndroid Build Coastguard Worker 17*f50c3066SAndroid Build Coastguard Workerimport net.ltgt.gradle.errorprone.CheckSeverity 18*f50c3066SAndroid Build Coastguard Worker 19*f50c3066SAndroid Build Coastguard Workerplugins { 20*f50c3066SAndroid Build Coastguard Worker id "java-library" 21*f50c3066SAndroid Build Coastguard Worker} 22*f50c3066SAndroid Build Coastguard Worker 23*f50c3066SAndroid Build Coastguard Workerdependencies { 24*f50c3066SAndroid Build Coastguard Worker annotationProcessor project(":nullaway") 25*f50c3066SAndroid Build Coastguard Worker implementation deps.build.jspecify 26*f50c3066SAndroid Build Coastguard Worker 27*f50c3066SAndroid Build Coastguard Worker compileOnly deps.build.jsr305Annotations 28*f50c3066SAndroid Build Coastguard Worker compileOnly deps.build.javaxValidation 29*f50c3066SAndroid Build Coastguard Worker compileOnly deps.test.cfQual 30*f50c3066SAndroid Build Coastguard Worker} 31*f50c3066SAndroid Build Coastguard Worker 32*f50c3066SAndroid Build Coastguard Workertasks.withType(JavaCompile) { 33*f50c3066SAndroid Build Coastguard Worker if (!name.toLowerCase().contains("test")) { 34*f50c3066SAndroid Build Coastguard Worker options.errorprone { 35*f50c3066SAndroid Build Coastguard Worker check("NullAway", CheckSeverity.ERROR) 36*f50c3066SAndroid Build Coastguard Worker option("NullAway:AnnotatedPackages", "com.uber") 37*f50c3066SAndroid Build Coastguard Worker option("NullAway:UnannotatedSubPackages", "com.uber.lib.unannotated") 38*f50c3066SAndroid Build Coastguard Worker } 39*f50c3066SAndroid Build Coastguard Worker } 40*f50c3066SAndroid Build Coastguard Worker} 41