xref: /aosp_15_r20/external/nullaway/jar-infer/jar-infer-lib/build.gradle (revision f50c306653bc89b8210ce6c9e0b0b44fc134bc03)
1*f50c3066SAndroid Build Coastguard Worker/*
2*f50c3066SAndroid Build Coastguard Worker * Copyright (C) 2021. 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 Workerplugins {
17*f50c3066SAndroid Build Coastguard Worker    id "java-library"
18*f50c3066SAndroid Build Coastguard Worker    id 'nullaway.java-test-conventions'
19*f50c3066SAndroid Build Coastguard Worker}
20*f50c3066SAndroid Build Coastguard Worker
21*f50c3066SAndroid Build Coastguard Worker// JarInfer requires JDK 11+, due to its dependence on WALA
22*f50c3066SAndroid Build Coastguard Workertasks.withType(JavaCompile) {
23*f50c3066SAndroid Build Coastguard Worker    java.sourceCompatibility = JavaVersion.VERSION_11
24*f50c3066SAndroid Build Coastguard Worker    java.targetCompatibility = JavaVersion.VERSION_11
25*f50c3066SAndroid Build Coastguard Worker}
26*f50c3066SAndroid Build Coastguard Worker
27*f50c3066SAndroid Build Coastguard Workerrepositories {
28*f50c3066SAndroid Build Coastguard Worker    mavenCentral()
29*f50c3066SAndroid Build Coastguard Worker    // uncomment if you want to use wala.dalvik or wala.scandroid
30*f50c3066SAndroid Build Coastguard Worker    //maven { url "https://raw.github.com/msridhar/maven-jars/mvn-repo/" }
31*f50c3066SAndroid Build Coastguard Worker}
32*f50c3066SAndroid Build Coastguard Worker
33*f50c3066SAndroid Build Coastguard Workerdependencies {
34*f50c3066SAndroid Build Coastguard Worker    api deps.build.asm
35*f50c3066SAndroid Build Coastguard Worker    api deps.build.asmTree
36*f50c3066SAndroid Build Coastguard Worker    api deps.build.wala
37*f50c3066SAndroid Build Coastguard Worker    api deps.build.guava
38*f50c3066SAndroid Build Coastguard Worker    api deps.build.commonsIO
39*f50c3066SAndroid Build Coastguard Worker    compileOnly deps.build.errorProneCheckApi
40*f50c3066SAndroid Build Coastguard Worker
41*f50c3066SAndroid Build Coastguard Worker    testImplementation deps.test.junit4
42*f50c3066SAndroid Build Coastguard Worker    testImplementation(deps.build.errorProneTestHelpers) {
43*f50c3066SAndroid Build Coastguard Worker        exclude group: "junit", module: "junit"
44*f50c3066SAndroid Build Coastguard Worker    }
45*f50c3066SAndroid Build Coastguard Worker    testImplementation project(":jar-infer:test-java-lib-jarinfer")
46*f50c3066SAndroid Build Coastguard Worker    testImplementation files("${System.properties['java.home']}/../lib/tools.jar") // is there a better way?
47*f50c3066SAndroid Build Coastguard Worker    testRuntimeOnly deps.build.errorProneCheckApi
48*f50c3066SAndroid Build Coastguard Worker}
49*f50c3066SAndroid Build Coastguard Worker
50*f50c3066SAndroid Build Coastguard Workertest {
51*f50c3066SAndroid Build Coastguard Worker    dependsOn ':jar-infer:test-android-lib-jarinfer:bundleReleaseAar'
52*f50c3066SAndroid Build Coastguard Worker}
53*f50c3066SAndroid Build Coastguard Worker
54*f50c3066SAndroid Build Coastguard Workertasks.withType(JavaCompile).configureEach {
55*f50c3066SAndroid Build Coastguard Worker    options.compilerArgs += "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"
56*f50c3066SAndroid Build Coastguard Worker}
57*f50c3066SAndroid Build Coastguard Worker
58*f50c3066SAndroid Build Coastguard Workerapply plugin: 'com.vanniktech.maven.publish'
59