diff --git a/buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle b/buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle index a45835bcae..437e304807 100644 --- a/buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle +++ b/buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle @@ -78,10 +78,14 @@ test { } // Tasks for testing on other JDK versions; see https://jakewharton.com/build-on-latest-java-test-through-lowest-java/ -[21].each { majorVersion -> +[21, 26].each { majorVersion -> def jdkTest = tasks.register("testJdk$majorVersion", Test) { javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(majorVersion) + // We prefer toolchains that include jmod files for the Java standard library, like Azul Zulu, + // for better compatibility with WALA / JarInfer. + // Temurin does not include jmod files as of their JDK 24 builds. + vendor = JvmVendorSpec.AZUL } description = "Runs the test suite on JDK $majorVersion" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d86b12f8b0..6dc73010b8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ asm = "9.3" check-framework = "4.0.0" support = "27.1.1" -wala = "1.6.12" +wala = "1.7.0" commons-cli = "1.4" auto-service = "1.1.1" google-java-format = "1.34.1" diff --git a/jdk-recent-unit-tests/build.gradle b/jdk-recent-unit-tests/build.gradle index 339527ddac..14651e67df 100644 --- a/jdk-recent-unit-tests/build.gradle +++ b/jdk-recent-unit-tests/build.gradle @@ -51,17 +51,15 @@ tasks.withType(Test).configureEach { test -> // Used by com.uber.nullaway.jdk17.NullAwayModuleInfoTests "-Dtest.module.path=${configurations.testModulePath.asPath}" ] + // The test module jar is consumed via the synthetic module path above, so every + // JDK-specific Test task needs it built before execution. + dependsOn ':test-java-module:jar' } -// Disable tasks for specific JDK versions; we only run on the recent JDK version specified above +// Disable tasks for specific JDK versions; we only run on the recent JDK version specified above and newer tasks.getByName('testJdk17').configure { onlyIf { false } } tasks.getByName('testJdk21').configure { onlyIf { false } } - -tasks.getByName('test').configure { - // we need this since we don't have an implementation / api dependence on test-java-module - dependsOn ':test-java-module:jar' -}