Repository navigation
[build] Bump Bouncy Castle to 1.87 in Gradle projects - #13622
Merged
Merged
Conversation
Three Gradle projects use Bouncy Castle 1.80.2 as a transitive dependency: * `src/manifestmerger`: from `com.android.tools:sdk-common:32.5.1`. This JAR ships in the SDK. * `src/proguard-android` and the `JavaLib` test project: from the Android Gradle Plugin 9.5.1. `manifest-merger` 32.5.1 and AGP 9.5.1 are the latest stable versions, so a direct dependency bump cannot update Bouncy Castle. Add `eng/gradle/dependency-constraints.gradle`, which sets `bcprov-jdk18on` and `bcpkix-jdk18on` to at least 1.87, and apply it from each affected `settings.gradle`. It adds the constraints to the buildscript classpath and to all project configurations, so it covers plugin dependencies too. Dependabot does not read this file, so its versions must be updated manually. Version 1.87 is already in the dnceng `dotnet-public-maven` mirror. Validation, with JDK 17 and `RUNNINGONCI=true`: each command gives BUILD SUCCESSFUL, and Bouncy Castle resolves only to 1.87. * `src/manifestmerger`: `gradlew build dependencies buildEnvironment -PjavaSourceVer=17 -PjavaTargetVer=17` * `src/proguard-android`: `gradlew extractProguardFiles dependencies buildEnvironment` * `JavaLib`: `gradlew assembleDebug buildEnvironment :library:dependencies` Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The imported dependency constraints file is missing from _BuildManifestMerger inputs, so changing only the centralized Bouncy Castle versions can leave the shipped JAR with stale dependencies.
1 open issue
What changed in this PR
Updates transitive Bouncy Castle dependencies across three Gradle projects, including the manifest merger shipped in the .NET for Android SDK.
Changes:
- Adds shared minimum-version constraints of 1.87 for
bcprov-jdk18onandbcpkix-jdk18on, covering buildscript and project dependencies. - Applies the constraints to manifestmerger, proguard-android, and the JavaLib test project.
- Documents centralized version maintenance and Dependabot limitations.
| File | Description |
|---|---|
tests/CodeGen-Binding/Xamarin.Android.LibraryProjectZip-LibBinding/java/JavaLib/settings.gradle |
Applies shared constraints to JavaLib. |
src/proguard-android/settings.gradle |
Applies shared constraints to proguard-android. |
src/manifestmerger/settings.gradle |
Applies shared constraints to the shipped manifest merger. |
eng/gradle/dependency-constraints.gradle |
Defines Bouncy Castle minimum versions for buildscript and project configurations. |
.github/instructions/gradle.instructions.md |
Documents how to apply and maintain transitive dependency constraints. |
Review effort: Balanced
… changes Co-authored-by: Copilot App <[email protected]>
Member
Author
|
@dalexsoto review |
jonathanpeppers
enabled stacked auto-merge (squash)
November 18, 2026 22:28
dalexsoto
approved these changes
Nov 18, 2026
dalexsoto
left a comment
Member
There was a problem hiding this comment.
Reviewed 5a8adb37 against main at 13a3e7d4 (merge-base 0402b6bd). This was a static, read-only review; I didn't build or run anything.
LGTM. What I checked:
eng/gradle/dependency-constraints.gradle: it's applied fromsettings.gradleand only usesgradle.beforeProject, which works there. Theclasspathconstraint also reaches plugins from theplugins {}block, including the Android Gradle Plugin's dependencies. ThecanBeDeclaredguard limits it to declarable configurations and is available in the repo's Gradle 9.6.0 wrapper. A plain constraint is a required version, so conflict resolution upgrades 1.80.2 to 1.87.apply frompaths:../..for the twosrc/*projects and../../../../..for JavaLib both resolve to the repo root, the same way each file's existing repository includes do.manifestmerger.jar: it's a fat jar built fromruntimeClasspath, so the shipped jar picks up 1.87. Copilot's earlier finding is fixed:_BuildManifestMergernow listsdependency-constraints.gradleas an input, and the path resolves correctly fromsrc/manifestmerger/.bcutil-jdk18on: thebcpkix-jdk18on1.87 POM depends onbcutil-jdk18on1.87, so the Bouncy Castle versions can't end up mixed. All three 1.87 artifacts are in the dncengdotnet-public-mavenmirror.- proguard-android and JavaLib: their targets don't list the new file as an input. That's fine: proguard-android only extracts ProGuard rule files from AGP, and JavaLib is a test project.
- No notices or packaging file pins a Bouncy Castle version, the new docs match the implementation, and none of the 13 commits on
mainsince the merge-base touch these paths.
Since I didn't run anything, your local Gradle results are the only build validation behind this review.
This was referenced Nov 19, 2026
jonathanpeppers
added a commit
that referenced
this pull request
Nov 19, 2026
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
added a commit
that referenced
this pull request
Nov 19, 2026
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Three Gradle projects use Bouncy Castle 1.80.2 as a transitive dependency:
src/manifestmerger: fromcom.android.tools:sdk-common:32.5.1. This JAR ships in the SDK.src/proguard-androidand theJavaLibtest project: from the Android Gradle Plugin 9.5.1.manifest-merger32.5.1 and AGP 9.5.1 are the latest stable versions, so a direct dependency bump cannot update Bouncy Castle.Add
eng/gradle/dependency-constraints.gradle, which setsbcprov-jdk18onandbcpkix-jdk18onto at least 1.87, and apply it from each affectedsettings.gradle. It adds the constraints to the buildscript classpath and to all project configurations, so it covers plugin dependencies too. Dependabot does not read this file, so its versions must be updated manually.Version 1.87 is already in the dnceng
dotnet-public-mavenmirror.Validation, with JDK 17 and
RUNNINGONCI=true: each command gives BUILD SUCCESSFUL, and Bouncy Castle resolves only to 1.87.src/manifestmerger:gradlew build dependencies buildEnvironment -PjavaSourceVer=17 -PjavaTargetVer=17src/proguard-android:gradlew extractProguardFiles dependencies buildEnvironmentJavaLib:gradlew assembleDebug buildEnvironment :library:dependenciesCo-authored-by: Copilot App [email protected]