aboutsummaryrefslogtreecommitdiff
path: root/nullaway/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'nullaway/build.gradle')
-rw-r--r--nullaway/build.gradle33
1 files changed, 18 insertions, 15 deletions
diff --git a/nullaway/build.gradle b/nullaway/build.gradle
index 90ac062..15327ae 100644
--- a/nullaway/build.gradle
+++ b/nullaway/build.gradle
@@ -21,7 +21,8 @@ plugins {
}
configurations {
- nullawayJar
+ // A configuration holding the jars for the oldest supported version of Error Prone, to use with tests
+ errorProneOldest
}
dependencies {
@@ -64,6 +65,14 @@ dependencies {
testImplementation deps.test.mockito
testImplementation deps.test.javaxAnnotationApi
testImplementation deps.test.assertJ
+ // This is for a test exposing a CFG construction failure in the Checker Framework. We can probably remove it once
+ // the issue is fixed upstream and we update. See https://github.com/typetools/checker-framework/issues/6396.
+ testImplementation 'org.apache.spark:spark-sql_2.12:3.3.2'
+
+ errorProneOldest deps.build.errorProneCheckApiOld
+ errorProneOldest(deps.build.errorProneTestHelpersOld) {
+ exclude group: "junit", module: "junit"
+ }
}
javadoc {
@@ -93,12 +102,10 @@ apply plugin: 'com.vanniktech.maven.publish'
// }
// Create a task to test on JDK 8
+// NOTE: even when we drop JDK 8 support, we will still need a test task similar to this one for testing building
+// against a recent JDK and Error Prone version but then running on the oldest supported JDK and Error Prone version,
+// to check for binary compatibility issues.
def jdk8Test = tasks.register("testJdk8", Test) {
- onlyIf {
- // Only if we are using a version of Error Prone compatible with JDK 8
- deps.versions.errorProneApi == "2.10.0"
- }
-
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(8)
}
@@ -108,7 +115,11 @@ def jdk8Test = tasks.register("testJdk8", Test) {
// Copy inputs from normal Test task.
def testTask = tasks.getByName("test")
- classpath = testTask.classpath
+ // A bit of a hack: we add the dependencies of the oldest supported Error Prone version to the _beginning_ of the
+ // classpath, so that they are used instead of the latest version. This exercises the scenario of building
+ // NullAway against the latest supported Error Prone version but then running on the oldest supported version.
+ classpath = configurations.errorProneOldest + testTask.classpath
+
testClassesDirs = testTask.testClassesDirs
jvmArgs "-Xbootclasspath/p:${configurations.errorproneJavac.asPath}"
filter {
@@ -124,14 +135,6 @@ tasks.named('check').configure {
dependsOn(jdk8Test)
}
-tasks.named('testJdk21', Test).configure {
- filter {
- // JSpecify Generics tests do not yet pass on JDK 21
- // See https://github.com/uber/NullAway/issues/827
- excludeTestsMatching "com.uber.nullaway.NullAwayJSpecifyGenericsTests"
- }
-}
-
// Create a task to build NullAway with NullAway checking enabled
tasks.register('buildWithNullAway', JavaCompile) {
onlyIf {