1*f50c3066SAndroid Build Coastguard Workerimport org.gradle.util.VersionNumber 2*f50c3066SAndroid Build Coastguard Worker 3*f50c3066SAndroid Build Coastguard Worker/* 4*f50c3066SAndroid Build Coastguard Worker * Copyright (C) 2017. Uber Technologies 5*f50c3066SAndroid Build Coastguard Worker * 6*f50c3066SAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 7*f50c3066SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 8*f50c3066SAndroid Build Coastguard Worker * You may obtain a copy of the License at 9*f50c3066SAndroid Build Coastguard Worker * 10*f50c3066SAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 11*f50c3066SAndroid Build Coastguard Worker * 12*f50c3066SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 13*f50c3066SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 14*f50c3066SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15*f50c3066SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 16*f50c3066SAndroid Build Coastguard Worker * limitations under the License. 17*f50c3066SAndroid Build Coastguard Worker */ 18*f50c3066SAndroid Build Coastguard Worker 19*f50c3066SAndroid Build Coastguard Worker// The oldest version of Error Prone that we support running on 20*f50c3066SAndroid Build Coastguard Workerdef oldestErrorProneVersion = "2.10.0" 21*f50c3066SAndroid Build Coastguard Worker// Latest released Error Prone version that we've tested with 22*f50c3066SAndroid Build Coastguard Workerdef latestErrorProneVersion = "2.24.1" 23*f50c3066SAndroid Build Coastguard Worker// Default to using latest tested Error Prone version 24*f50c3066SAndroid Build Coastguard Workerdef defaultErrorProneVersion = latestErrorProneVersion 25*f50c3066SAndroid Build Coastguard Workerdef errorProneVersionToCompileAgainst = defaultErrorProneVersion 26*f50c3066SAndroid Build Coastguard Worker 27*f50c3066SAndroid Build Coastguard Worker// If the epApiVersion project property is set, compile and test against that version of Error Prone 28*f50c3066SAndroid Build Coastguard Workerif (project.hasProperty("epApiVersion")) { 29*f50c3066SAndroid Build Coastguard Worker def epApiVNum = VersionNumber.parse(epApiVersion) 30*f50c3066SAndroid Build Coastguard Worker if (epApiVNum.equals(VersionNumber.UNKNOWN)) { 31*f50c3066SAndroid Build Coastguard Worker throw new IllegalArgumentException("Invalid Error Prone API version " + epApiVersion) 32*f50c3066SAndroid Build Coastguard Worker } 33*f50c3066SAndroid Build Coastguard Worker if (epApiVNum.compareTo(VersionNumber.parse(oldestErrorProneVersion)) < 0) { 34*f50c3066SAndroid Build Coastguard Worker throw new IllegalArgumentException( 35*f50c3066SAndroid Build Coastguard Worker "Error Prone API version " + epApiVersion + " is too old; " 36*f50c3066SAndroid Build Coastguard Worker + oldestErrorProneVersion + " is the oldest supported version") 37*f50c3066SAndroid Build Coastguard Worker } 38*f50c3066SAndroid Build Coastguard Worker errorProneVersionToCompileAgainst = epApiVersion 39*f50c3066SAndroid Build Coastguard Worker} 40*f50c3066SAndroid Build Coastguard Worker 41*f50c3066SAndroid Build Coastguard Workerdef versions = [ 42*f50c3066SAndroid Build Coastguard Worker asm : "9.3", 43*f50c3066SAndroid Build Coastguard Worker checkerFramework : "3.40.0", 44*f50c3066SAndroid Build Coastguard Worker // for comparisons in other parts of the build 45*f50c3066SAndroid Build Coastguard Worker errorProneLatest : latestErrorProneVersion, 46*f50c3066SAndroid Build Coastguard Worker // The version of Error Prone used to check NullAway's code. 47*f50c3066SAndroid Build Coastguard Worker errorProne : defaultErrorProneVersion, 48*f50c3066SAndroid Build Coastguard Worker // The version of Error Prone that NullAway is compiled and tested against 49*f50c3066SAndroid Build Coastguard Worker errorProneApi : errorProneVersionToCompileAgainst, 50*f50c3066SAndroid Build Coastguard Worker support : "27.1.1", 51*f50c3066SAndroid Build Coastguard Worker wala : "1.6.3", 52*f50c3066SAndroid Build Coastguard Worker commonscli : "1.4", 53*f50c3066SAndroid Build Coastguard Worker autoValue : "1.10.2", 54*f50c3066SAndroid Build Coastguard Worker autoService : "1.1.1", 55*f50c3066SAndroid Build Coastguard Worker] 56*f50c3066SAndroid Build Coastguard Worker 57*f50c3066SAndroid Build Coastguard Workerdef apt = [ 58*f50c3066SAndroid Build Coastguard Worker autoValue : "com.google.auto.value:auto-value:${versions.autoValue}", 59*f50c3066SAndroid Build Coastguard Worker autoValueAnnot : "com.google.auto.value:auto-value-annotations:${versions.autoValue}", 60*f50c3066SAndroid Build Coastguard Worker autoService : "com.google.auto.service:auto-service:${versions.autoService}", 61*f50c3066SAndroid Build Coastguard Worker autoServiceAnnot : "com.google.auto.service:auto-service-annotations:${versions.autoService}", 62*f50c3066SAndroid Build Coastguard Worker jakartaInject : "jakarta.inject:jakarta.inject-api:2.0.0", 63*f50c3066SAndroid Build Coastguard Worker javaxInject : "javax.inject:javax.inject:1", 64*f50c3066SAndroid Build Coastguard Worker] 65*f50c3066SAndroid Build Coastguard Worker 66*f50c3066SAndroid Build Coastguard Workerdef build = [ 67*f50c3066SAndroid Build Coastguard Worker asm : "org.ow2.asm:asm:${versions.asm}", 68*f50c3066SAndroid Build Coastguard Worker asmTree : "org.ow2.asm:asm-tree:${versions.asm}", 69*f50c3066SAndroid Build Coastguard Worker errorProneCheckApi : "com.google.errorprone:error_prone_check_api:${versions.errorProneApi}", 70*f50c3066SAndroid Build Coastguard Worker errorProneCheckApiOld : "com.google.errorprone:error_prone_check_api:${oldestErrorProneVersion}", 71*f50c3066SAndroid Build Coastguard Worker errorProneCore : "com.google.errorprone:error_prone_core:${versions.errorProne}", 72*f50c3066SAndroid Build Coastguard Worker errorProneCoreForApi : "com.google.errorprone:error_prone_core:${versions.errorProneApi}", 73*f50c3066SAndroid Build Coastguard Worker errorProneJavac : "com.google.errorprone:javac:9+181-r4173-1", 74*f50c3066SAndroid Build Coastguard Worker errorProneTestHelpers : "com.google.errorprone:error_prone_test_helpers:${versions.errorProneApi}", 75*f50c3066SAndroid Build Coastguard Worker errorProneTestHelpersOld: "com.google.errorprone:error_prone_test_helpers:${oldestErrorProneVersion}", 76*f50c3066SAndroid Build Coastguard Worker checkerDataflow : "org.checkerframework:dataflow-nullaway:${versions.checkerFramework}", 77*f50c3066SAndroid Build Coastguard Worker guava : "com.google.guava:guava:30.1-jre", 78*f50c3066SAndroid Build Coastguard Worker javaxValidation : "javax.validation:validation-api:2.0.1.Final", 79*f50c3066SAndroid Build Coastguard Worker jspecify : "org.jspecify:jspecify:0.3.0", 80*f50c3066SAndroid Build Coastguard Worker jsr305Annotations : "com.google.code.findbugs:jsr305:3.0.2", 81*f50c3066SAndroid Build Coastguard Worker commonsIO : "commons-io:commons-io:2.11.0", 82*f50c3066SAndroid Build Coastguard Worker wala : [ 83*f50c3066SAndroid Build Coastguard Worker "com.ibm.wala:com.ibm.wala.util:${versions.wala}", 84*f50c3066SAndroid Build Coastguard Worker "com.ibm.wala:com.ibm.wala.shrike:${versions.wala}", 85*f50c3066SAndroid Build Coastguard Worker "com.ibm.wala:com.ibm.wala.core:${versions.wala}" 86*f50c3066SAndroid Build Coastguard Worker ], 87*f50c3066SAndroid Build Coastguard Worker commonscli : "commons-cli:commons-cli:${versions.commonscli}", 88*f50c3066SAndroid Build Coastguard Worker 89*f50c3066SAndroid Build Coastguard Worker // android stuff 90*f50c3066SAndroid Build Coastguard Worker compileSdkVersion: 30, 91*f50c3066SAndroid Build Coastguard Worker ci: "true" == System.getenv("CI"), 92*f50c3066SAndroid Build Coastguard Worker minSdkVersion: 16, 93*f50c3066SAndroid Build Coastguard Worker targetSdkVersion: 30, 94*f50c3066SAndroid Build Coastguard Worker 95*f50c3066SAndroid Build Coastguard Worker] 96*f50c3066SAndroid Build Coastguard Worker 97*f50c3066SAndroid Build Coastguard Workerdef support = [ 98*f50c3066SAndroid Build Coastguard Worker appcompat : "com.android.support:appcompat-v7:${versions.support}" 99*f50c3066SAndroid Build Coastguard Worker] 100*f50c3066SAndroid Build Coastguard Worker 101*f50c3066SAndroid Build Coastguard Workerdef test = [ 102*f50c3066SAndroid Build Coastguard Worker junit4 : "junit:junit:4.13.2", 103*f50c3066SAndroid Build Coastguard Worker junit5Jupiter : [ 104*f50c3066SAndroid Build Coastguard Worker "org.junit.jupiter:junit-jupiter-api:5.0.2", 105*f50c3066SAndroid Build Coastguard Worker "org.apiguardian:apiguardian-api:1.0.0" 106*f50c3066SAndroid Build Coastguard Worker ], 107*f50c3066SAndroid Build Coastguard Worker jetbrainsAnnotations : "org.jetbrains:annotations:24.1.0", 108*f50c3066SAndroid Build Coastguard Worker cfQual : "org.checkerframework:checker-qual:${versions.checkerFramework}", 109*f50c3066SAndroid Build Coastguard Worker // 2.5.5 is the last release to contain this artifact 110*f50c3066SAndroid Build Coastguard Worker cfCompatQual : "org.checkerframework:checker-compat-qual:2.5.5", 111*f50c3066SAndroid Build Coastguard Worker rxjava2 : "io.reactivex.rxjava2:rxjava:2.1.2", 112*f50c3066SAndroid Build Coastguard Worker commonsLang3 : "org.apache.commons:commons-lang3:3.8.1", 113*f50c3066SAndroid Build Coastguard Worker commonsLang : "commons-lang:commons-lang:2.6", 114*f50c3066SAndroid Build Coastguard Worker lombok : "org.projectlombok:lombok:1.18.24", 115*f50c3066SAndroid Build Coastguard Worker springBeans : "org.springframework:spring-beans:5.3.7", 116*f50c3066SAndroid Build Coastguard Worker springContext : "org.springframework:spring-context:5.3.7", 117*f50c3066SAndroid Build Coastguard Worker grpcCore : "io.grpc:grpc-core:1.15.1", // Should upgrade, but this matches our guava version 118*f50c3066SAndroid Build Coastguard Worker mockito : "org.mockito:mockito-core:5.5.0", 119*f50c3066SAndroid Build Coastguard Worker javaxAnnotationApi : "javax.annotation:javax.annotation-api:1.3.2", 120*f50c3066SAndroid Build Coastguard Worker assertJ : "org.assertj:assertj-core:3.23.1", 121*f50c3066SAndroid Build Coastguard Worker] 122*f50c3066SAndroid Build Coastguard Worker 123*f50c3066SAndroid Build Coastguard Workerext.deps = [ 124*f50c3066SAndroid Build Coastguard Worker "apt": apt, 125*f50c3066SAndroid Build Coastguard Worker "build": build, 126*f50c3066SAndroid Build Coastguard Worker "support": support, 127*f50c3066SAndroid Build Coastguard Worker "test": test, 128*f50c3066SAndroid Build Coastguard Worker "versions": versions 129*f50c3066SAndroid Build Coastguard Worker] 130