From ad676e3c1db2ae7ca1a531eb7442f271827781c3 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Sun, 22 Dec 2024 17:24:52 -0500 Subject: [PATCH 1/7] WIP --- .github/workflows/continuous-integration.yml | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index fcb2fb1602..b1b84b83c5 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -76,3 +76,29 @@ jobs: if: matrix.java == '17' - name: Check that Git tree is clean after build and test run: ./.buildscript/check_git_clean.sh + caffeine-gradle-task: + runs-on: ubuntu-latest + + steps: + - name: Checkout this repository + uses: actions/checkout@v4 + - name: 'Set up JDKs' + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: 'temurin' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Publish to Maven Local + env: + ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: 'false' + run: ./gradlew publishToMavenLocal + - name: Create a temporary directory for Caffeine + run: mkdir -p /tmp/caffeine + - name: Clone Caffeine repository + run: | + git clone --depth 1 --branch main https://github.com/ben-manes/caffeine.git /tmp/caffeine + - name: Run caffeine build + run: | + cd /tmp/caffeine + ./gradlew build -x test -x javadoc From 2e462ce32e34a2645dae0385d49871c7f6ab37f5 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Sun, 22 Dec 2024 17:27:19 -0500 Subject: [PATCH 2/7] tweak --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b1b84b83c5..6fbae82d5e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -97,7 +97,7 @@ jobs: run: mkdir -p /tmp/caffeine - name: Clone Caffeine repository run: | - git clone --depth 1 --branch main https://github.com/ben-manes/caffeine.git /tmp/caffeine + git clone --depth 1 https://github.com/ben-manes/caffeine.git /tmp/caffeine - name: Run caffeine build run: | cd /tmp/caffeine From 06d1f1ae1ad67c63446794cad5d49f556a1ff3c4 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Sun, 22 Dec 2024 17:31:50 -0500 Subject: [PATCH 3/7] more --- .github/workflows/continuous-integration.yml | 3 ++- nullaway-override.gradle.kts | 22 +++++++++++++++++++ .../main/java/com/uber/nullaway/NullAway.java | 3 +++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 nullaway-override.gradle.kts diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 6fbae82d5e..fd415ed3d0 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -100,5 +100,6 @@ jobs: git clone --depth 1 https://github.com/ben-manes/caffeine.git /tmp/caffeine - name: Run caffeine build run: | + cp nullaway-override.gradle.kts /tmp/caffeine cd /tmp/caffeine - ./gradlew build -x test -x javadoc + ./gradlew --init-script nullaway-override.gradle.kts build -x test -x javadoc diff --git a/nullaway-override.gradle.kts b/nullaway-override.gradle.kts new file mode 100644 index 0000000000..bb98802caa --- /dev/null +++ b/nullaway-override.gradle.kts @@ -0,0 +1,22 @@ +allprojects { + repositories { + mavenCentral() + mavenLocal() + gradlePluginPortal() + } +} + +gradle.projectsLoaded { + rootProject.allprojects { + configurations.all { + resolutionStrategy { + eachDependency { + if (requested.group == "com.uber.nullaway") { + useVersion("+") + } + } + cacheChangingModulesFor(0, "seconds") + } + } + } +} \ No newline at end of file diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java index 8611cade8c..c036313832 100644 --- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java +++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java @@ -483,6 +483,9 @@ public Description matchAssignment(AssignmentTree tree, VisitorState state) { if (!withinAnnotatedCode(state)) { return Description.NO_MATCH; } + if (true) { + throw new RuntimeException("test"); + } Type lhsType = ASTHelpers.getType(tree.getVariable()); if (lhsType != null && lhsType.isPrimitive()) { doUnboxingCheck(state, tree.getExpression()); From 80f19ed1a40e0708b4808001e6c3ec1a57b87572 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Sun, 22 Dec 2024 17:37:10 -0500 Subject: [PATCH 4/7] undo --- nullaway/src/main/java/com/uber/nullaway/NullAway.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/nullaway/src/main/java/com/uber/nullaway/NullAway.java b/nullaway/src/main/java/com/uber/nullaway/NullAway.java index c036313832..8611cade8c 100644 --- a/nullaway/src/main/java/com/uber/nullaway/NullAway.java +++ b/nullaway/src/main/java/com/uber/nullaway/NullAway.java @@ -483,9 +483,6 @@ public Description matchAssignment(AssignmentTree tree, VisitorState state) { if (!withinAnnotatedCode(state)) { return Description.NO_MATCH; } - if (true) { - throw new RuntimeException("test"); - } Type lhsType = ASTHelpers.getType(tree.getVariable()); if (lhsType != null && lhsType.isPrimitive()) { doUnboxingCheck(state, tree.getExpression()); From fd5c62e638e439cc83c8558ec1ee59a7d292ce18 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Sun, 22 Dec 2024 21:51:10 -0500 Subject: [PATCH 5/7] remove and move --- .../workflows/caffeine-use-snapshot.gradle.kts | 0 .github/workflows/continuous-integration.yml | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename nullaway-override.gradle.kts => .github/workflows/caffeine-use-snapshot.gradle.kts (100%) diff --git a/nullaway-override.gradle.kts b/.github/workflows/caffeine-use-snapshot.gradle.kts similarity index 100% rename from nullaway-override.gradle.kts rename to .github/workflows/caffeine-use-snapshot.gradle.kts diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index fd415ed3d0..300668e92e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -100,6 +100,6 @@ jobs: git clone --depth 1 https://github.com/ben-manes/caffeine.git /tmp/caffeine - name: Run caffeine build run: | - cp nullaway-override.gradle.kts /tmp/caffeine + cp .github/workflows/caffeine-use-snapshot.gradle.kts /tmp/caffeine cd /tmp/caffeine - ./gradlew --init-script nullaway-override.gradle.kts build -x test -x javadoc + ./gradlew --init-script caffeine-use-snapshot.gradle.kts build -x test -x javadoc From 176ca83ace92ebf635448a5901df43f1a0be7f20 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Sun, 22 Dec 2024 21:52:08 -0500 Subject: [PATCH 6/7] rename --- .github/workflows/continuous-integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 300668e92e..2a50c46737 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -77,6 +77,7 @@ jobs: - name: Check that Git tree is clean after build and test run: ./.buildscript/check_git_clean.sh caffeine-gradle-task: + name: "Build Caffeine with snapshot" runs-on: ubuntu-latest steps: From b78630726e7b8e24e8fed3e6de6c1ff5f36377b4 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Mon, 23 Dec 2024 09:01:07 -0500 Subject: [PATCH 7/7] minor --- .github/workflows/caffeine-use-snapshot.gradle.kts | 3 ++- .github/workflows/continuous-integration.yml | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/caffeine-use-snapshot.gradle.kts b/.github/workflows/caffeine-use-snapshot.gradle.kts index bb98802caa..0ef5d34e74 100644 --- a/.github/workflows/caffeine-use-snapshot.gradle.kts +++ b/.github/workflows/caffeine-use-snapshot.gradle.kts @@ -1,3 +1,4 @@ +// An init script to override Caffeine's build configuration to use a snapshot version of NullAway allprojects { repositories { mavenCentral() @@ -19,4 +20,4 @@ gradle.projectsLoaded { } } } -} \ No newline at end of file +} diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 2a50c46737..f0d6658111 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -97,8 +97,7 @@ jobs: - name: Create a temporary directory for Caffeine run: mkdir -p /tmp/caffeine - name: Clone Caffeine repository - run: | - git clone --depth 1 https://github.com/ben-manes/caffeine.git /tmp/caffeine + run: git clone --depth 1 https://github.com/ben-manes/caffeine.git /tmp/caffeine - name: Run caffeine build run: | cp .github/workflows/caffeine-use-snapshot.gradle.kts /tmp/caffeine