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