1/* 2 * Copyright (C) 2021. Uber Technologies 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16plugins { 17 id "java-library" 18 id 'nullaway.jacoco-conventions' 19} 20 21sourceCompatibility = 1.8 22 23repositories { 24 mavenCentral() 25 // uncomment if you want to use wala.dalvik or wala.scandroid 26 //maven { url "https://raw.github.com/msridhar/maven-jars/mvn-repo/" } 27} 28 29dependencies { 30 api deps.build.asm 31 api deps.build.asmTree 32 api deps.build.wala 33 api deps.build.guava 34 api deps.build.commonsIO 35 compileOnly deps.build.errorProneCheckApi 36 37 testImplementation deps.test.junit4 38 testImplementation(deps.build.errorProneTestHelpers) { 39 exclude group: "junit", module: "junit" 40 } 41 testImplementation project(":jar-infer:test-java-lib-jarinfer") 42 testImplementation project(path: ":jar-infer:test-android-lib-jarinfer", configuration: "default") 43 testImplementation files("${System.properties['java.home']}/../lib/tools.jar") // is there a better way? 44 testRuntimeOnly deps.build.errorProneCheckApi 45} 46 47test { 48 maxHeapSize = "1024m" 49 if (!JavaVersion.current().java9Compatible) { 50 jvmArgs "-Xbootclasspath/p:${configurations.errorproneJavac.asPath}" 51 } else { 52 // to expose necessary JDK types on JDK 16+; see https://errorprone.info/docs/installation#java-9-and-newer 53 jvmArgs += [ 54 "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED", 55 "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", 56 "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED", 57 "--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED", 58 "--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED", 59 "--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED", 60 "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", 61 "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", 62 "--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", 63 "--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED", 64 // Accessed by Lombok tests 65 "--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED", 66 ] 67 } 68} 69 70apply plugin: 'com.vanniktech.maven.publish' 71