From 87faaf06a590f6aefda2f2c90f80f08fcda84da5 Mon Sep 17 00:00:00 2001 From: "David P. Baker" Date: Mon, 3 Oct 2022 16:58:45 -0400 Subject: [PATCH] Pass CI on Java 17. (#36) --- .github/workflows/build.yml | 5 ++--- build.gradle | 9 +++++++-- initialize-project | 8 ++++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db3155b..5fd5c51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,10 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up JDK 11 # Java version tested by the Checker Framework - uses: actions/setup-java@v1 + - uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - uses: actions/cache@v1 with: path: ~/.gradle/caches diff --git a/build.gradle b/build.gradle index f6ec2e3..3c79094 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id 'com.diffplug.gradle.spotless' version '4.0.1' id 'eclipse' // https://github.com/tbroyer/gradle-errorprone-plugin - id 'net.ltgt.errorprone' version '1.3.0' + id 'net.ltgt.errorprone' version '2.0.2' } repositories { @@ -37,7 +37,7 @@ dependencies { testImplementation files("${cfHome}/framework-test/build/libs/framework-test-3.21.5-SNAPSHOT.jar") errorproneJavac "com.google.errorprone:javac:9+181-r4173-1" - errorprone "com.google.errorprone:error_prone_core:2.4.0" + errorprone "com.google.errorprone:error_prone_core:2.15.0" } tasks.withType(JavaCompile).all { @@ -68,6 +68,11 @@ tasks.withType(Test) { jvmArgs "-Xbootclasspath/p:${configurations.errorproneJavac.asPath}" } + // Required because checker-framework uses APIs from these modules. + jvmArgs( + ["code", "comp", "main", "processing", "tree", "util"] + .collect { "--add-opens=jdk.compiler/com.sun.tools.javac.$it=ALL-UNNAMED" }) + testLogging { showStackTraces = false showStandardStreams = true diff --git a/initialize-project b/initialize-project index c5e6be9..ea3d098 100755 --- a/initialize-project +++ b/initialize-project @@ -12,11 +12,15 @@ if [[ ! -d "${PLUME_SCRIPTS}" ]]; then fi if [[ ! -d "${CHECKER_FRAMEWORK}" ]]; then - "${PLUME_SCRIPTS}"/git-clone-related jspecify checker-framework -q + "${PLUME_SCRIPTS}"/git-clone-related jspecify checker-framework fi if [[ ! -d "${JSPECIFY}" ]]; then # We test using some modified samples in a different branch of the jspecify # repo, so we check out that branch. - "${PLUME_SCRIPTS}"/git-clone-related --upstream-branch samples-google-prototype jspecify jspecify -q + "${PLUME_SCRIPTS}"/git-clone-related --upstream-branch samples-google-prototype jspecify jspecify +fi + +if [[ ! -d "../jdk" ]]; then + "${PLUME_SCRIPTS}"/git-clone-related jspecify jdk fi