Skip to content

[build] Bump Guava to 33.7.2-jre in Gradle projects - #13627

Merged
jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-fix-guava-gradle
Nov 19, 2026
Merged

jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers-fix-guava-gradle

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Context: #13622

Guava is a transitive dependency of four Gradle projects:

  • src/java-source-utils: 33.6.0-jre, from javaparser 3.28.2
  • src/manifestmerger: 33.4.0-jre, from manifest-merger 32.5.1
  • src/proguard-android and JavaLib: 33.4.0-jre, from AGP 9.5.1

These direct dependencies are already the latest stable versions, so add Guava to eng/gradle/dependency-constraints.gradle and apply that file from src/java-source-utils/settings.gradle.

Guava 33.7 no longer depends on jsr305 and calls signature-polymorphic VarHandle methods, so ProGuard fails in src/manifestmerger:

Warning: com.google.common.jimfs.AbstractWatchService: can't find referenced class javax.annotation.Nullable
Warning: com.google.common.hash.LittleEndianByteArray$VarHandleLittleEndianBytes$1: can't find referenced method 'long get(byte[],int)' in library class java.lang.invoke.VarHandle

Ignore both in proguard.pro. jimfs only uses the JSR 305 annotations, which are not needed at run time, and VarHandle is the same case as the existing MethodHandle rule.

Validation, with JDK 17: each build succeeds, and Guava resolves only to 33.7.2-jre.

  • src/java-source-utils: gradlew jar test (18 tests passed)
  • src/manifestmerger: gradlew build dependencies
  • src/proguard-android: gradlew extractProguardFiles buildEnvironment dependencies
  • JavaLib: gradlew assembleDebug buildEnvironment :library:dependencies

Co-authored-by: Copilot App [email protected]

Copilot AI balanced review requested due to automatic review settings November 18, 2026 16:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The Guava dependency update has no active review issues.

No open issues 🎉

What changed in this PR

Updates transitive Guava dependencies to 33.7.2-jre using the shared Gradle constraint mechanism introduced in #13622.

Changes:

  • Adds the Guava constraint and applies shared constraints to java-source-utils.
  • Tracks settings and constraint changes as inputs to the Java build target.
  • Suppresses ProGuard warnings for missing JSR 305 annotations and signature-polymorphic VarHandle calls.
File Description
src/​manifestmerger/​proguard.pro Adds warning suppressions needed for the Guava update.
src/​java-source-utils/​settings.gradle Applies shared dependency constraints.
src/​java-source-utils/​java-source-utils.targets Adds settings and constraints to incremental build inputs.
eng/​gradle/​dependency-constraints.gradle Adds the shared Guava 33.7.2-jre constraint.

Review effort: Balanced

Base automatically changed from jonathanpeppers-fix-bouncycastle-gradle to main November 19, 2026 11:55
Context: #13622

Guava is a transitive dependency of four Gradle projects:

  * `src/java-source-utils`: 33.6.0-jre, from javaparser 3.28.2
  * `src/manifestmerger`: 33.4.0-jre, from `manifest-merger` 32.5.1
  * `src/proguard-android` and `JavaLib`: 33.4.0-jre, from AGP 9.5.1

These direct dependencies are already the latest stable versions, so add Guava to `eng/gradle/dependency-constraints.gradle` and apply that file from `src/java-source-utils/settings.gradle`.

Guava 33.7 no longer depends on `jsr305` and calls signature-polymorphic `VarHandle` methods, so ProGuard fails in `src/manifestmerger`:

    Warning: com.google.common.jimfs.AbstractWatchService: can't find referenced class javax.annotation.Nullable
    Warning: com.google.common.hash.LittleEndianByteArray$VarHandleLittleEndianBytes$1: can't find referenced method 'long get(byte[],int)' in library class java.lang.invoke.VarHandle

Ignore both in `proguard.pro`. jimfs only uses the JSR 305 annotations, which are not needed at run time, and `VarHandle` is the same case as the existing `MethodHandle` rule.

Validation, with JDK 17: each build succeeds, and Guava resolves only to 33.7.2-jre.

  * `src/java-source-utils`: `gradlew jar test` (18 tests passed)
  * `src/manifestmerger`: `gradlew build dependencies`
  * `src/proguard-android`: `gradlew extractProguardFiles buildEnvironment dependencies`
  * `JavaLib`: `gradlew assembleDebug buildEnvironment :library:dependencies`

Co-authored-by: Copilot App <[email protected]>
@jonathanpeppers
jonathanpeppers force-pushed the jonathanpeppers-fix-guava-gradle branch from 07b1278 to 86780bc Compare November 19, 2026 11:55
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Nov 19, 2026
@jonathanpeppers
jonathanpeppers enabled stacked auto-merge (squash) November 19, 2026 18:54
@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Guava constraint update and its Gradle and ProGuard integration look good to me.

@jonathanpeppers
jonathanpeppers merged commit 42b0fef into main Nov 19, 2026
47 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-fix-guava-gradle branch November 19, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants