4141 // or
4242 // ./gradlew sometask -PuseJdk21Compiler=true
4343
44- gradleRunsOnJava17orHigher = JavaVersion . current() >= JavaVersion . VERSION_17
4544 gradleRunsOnJava21orHigher = JavaVersion . current() >= JavaVersion . VERSION_21
4645 gradleRunsOnJava22orHigher = JavaVersion . current() >= JavaVersion . VERSION_22
4746 gradleRunsOnJava24orHigher = JavaVersion . current() >= JavaVersion . VERSION_24
@@ -156,9 +155,6 @@ allprojects { currentProj ->
156155 }
157156
158157 configurations {
159- // This is required to run the Checker Framework on JDK 8.
160- javacJar
161-
162158 // Holds the combined classpath of all subprojects including the subprojects themselves.
163159 allProjects
164160
@@ -173,8 +169,6 @@ allprojects { currentProj ->
173169 dependencies {
174170 errorprone(libs. error. prone. core)
175171
176- javacJar(libs. javac)
177-
178172 allProjects(subprojects)
179173 }
180174
@@ -847,15 +841,24 @@ subprojects {
847841 // When you add one here, also update a dependsOn(item for the "typecheck" task.)
848842 createCheckTypeTask(project. name, " Formatter" ,
849843 " org.checkerframework.checker.formatter.FormatterChecker" )
844+
845+ def checkInterningArgs = [
846+ " -Astubs=javax-lang-model-element-name.astub"
847+ ]
848+ if ((project. name. equals(" checker-qual" )
849+ || project. name. equals(" checker-util" )
850+ || project. name. equals(" checker-qual-android" ))) {
851+ // Because these projects use --release=11, the stubparser issues warnings like:
852+ // warning: javax-lang-model-element-name.astub:(line 11,col 1): Package not found: com.sun.tools.javac.util
853+ // so just suppress them.
854+ checkInterningArgs + = " -AstubNoWarnIfNotFound"
855+ }
856+
857+
850858 createCheckTypeTask(project. name, " Interning" ,
851859 " org.checkerframework.checker.interning.InterningChecker" ,
852- [
853- " -Astubs=javax-lang-model-element-name.astub" ,
854- // The stubparser gives a warning on the package, but the class is still found.
855- // warning: javax-lang-model-element-name.astub:(line 11,col 1): Package not found: com.sun.tools.javac.util
856- // 1 error
857- " -AstubNoWarnIfNotFound"
858- ])
860+ checkInterningArgs)
861+
859862 createCheckTypeTask(project. name, " Optional" ,
860863 " org.checkerframework.checker.optional.OptionalChecker" ,
861864 [
0 commit comments