aboutsummaryrefslogtreecommitdiff
path: root/jar-infer/jar-infer-lib/build.gradle
blob: 2ae8bea7a8e0a9c083bd6d4f9bf8628b18b8d7f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * Copyright (C) 2021. Uber Technologies
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
plugins {
    id "java-library"
    id 'nullaway.java-test-conventions'
}

// JarInfer requires JDK 11+, due to its dependence on WALA
tasks.withType(JavaCompile) {
    java.sourceCompatibility = JavaVersion.VERSION_11
    java.targetCompatibility = JavaVersion.VERSION_11
}

repositories {
    mavenCentral()
    // uncomment if you want to use wala.dalvik or wala.scandroid
    //maven { url "https://raw.github.com/msridhar/maven-jars/mvn-repo/" }
}

dependencies {
    api deps.build.asm
    api deps.build.asmTree
    api deps.build.wala
    api deps.build.guava
    api deps.build.commonsIO
    compileOnly deps.build.errorProneCheckApi

    testImplementation deps.test.junit4
    testImplementation(deps.build.errorProneTestHelpers) {
        exclude group: "junit", module: "junit"
    }
    testImplementation project(":jar-infer:test-java-lib-jarinfer")
    testImplementation files("${System.properties['java.home']}/../lib/tools.jar") // is there a better way?
    testRuntimeOnly deps.build.errorProneCheckApi
}

test {
    dependsOn ':jar-infer:test-android-lib-jarinfer:bundleReleaseAar'
}

tasks.named('testJdk21', Test).configure {
    // Tests fail since WALA does not yet support JDK 21; see https://github.com/uber/NullAway/issues/829
    // So, disable them
    onlyIf { false }
}

tasks.withType(JavaCompile).configureEach {
    options.compilerArgs += "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"
}

apply plugin: 'com.vanniktech.maven.publish'