Open
Conversation
Gradle 9 removed several deprecated APIs that this plugin relied on.
This commit updates the plugin to use the new APIs and modernizes the
build configuration to support the changes.
1. Core API Changes (Gradle 9 removals)
- Replace `fileMode = 493` with `filePermissions { unix("rwxr-xr-x") }`
The CopySpec.fileMode property was deprecated in Gradle 8 and removed
in Gradle 9. The new filePermissions API provides the same functionality.
- Replace `project.exec {}` with injected `ExecOperations.exec {}`
The Project.exec() method was deprecated in Gradle 7.5 and removed in
Gradle 9. Tasks must now use service injection to obtain ExecOperations.
This requires changing task classes from `open class` to `abstract class`.
2. Build Configuration Updates
These changes are required because the new Gradle 9 APIs (filePermissions,
ExecOperations) are only available in Gradle 8.3+, so we must compile
against a newer Gradle version:
- Gradle wrapper: 7.1.1 → 8.5
Required to compile against the new APIs (filePermissions added in 8.3)
- Kotlin: 1.3.50 → 1.9.22
The old Kotlin Gradle plugin uses APIs removed in Gradle 8.x
- AGP: 4.0.1 → 8.2.0
Required for Gradle 8.5+ compatibility
- Java target: 1.8 → 17
Required by both Gradle 8.5+ and AGP 8.x
- plugin-publish: 0.14.0 → 1.2.1
The old version uses the `pluginBundle {}` DSL which was removed.
Metadata (website, vcsUrl, tags) now goes in `gradlePlugin {}` block.
- Add Guava dependency
Versions.groovy uses Guava collections which were previously provided
transitively by AGP 4.x but are no longer included in AGP 8.x.
- Add `null` branch to `when` expression in CargoBuildTask
Kotlin 1.7+ requires exhaustive `when` for sealed classes with
nullable types.
3. Test Matrix Updates
- Updated supportedVersions to test AGP 8.x with Gradle 8.x
- Updated jdkVersionFor() to use Java 17 for AGP 8.x
Fixes mozilla#160
klochowicz
commented
Jan 27, 2026
| // there's a way to specify them in the cargo command line -- rustc accepts | ||
| // them if passed in directly with `--cfg`, and cargo will pass them to rustc | ||
| // if you use them as default featureSpec. | ||
| // Kotlin 1.9+ requires exhaustive when for sealed classes with nullable types |
Author
There was a problem hiding this comment.
happy to remove all the comments in the review process, but figured it would be easier to understand how this small file permissions change (the actual removed API) triggered cascading change in other dependencies.
klochowicz
commented
Jan 27, 2026
Comment on lines
-32
to
+42
| "7.0.0": ["7.1.1"], | ||
| "4.2.2": ["6.8.3", "7.1.1"], | ||
| "4.1.3": ["6.5.1", "6.8.3"], | ||
| "4.0.2": ["6.1.1", "6.8.3"], | ||
| "3.6.4": ["5.6.4", "6.8.3"], | ||
| "3.5.4": ["5.4.1", "5.6.4", "6.8.3"], | ||
| "3.1.2": ["4.10.2"] | ||
| "8.2.0": ["8.5"], | ||
| "8.3.0": ["8.5"], | ||
| "8.4.0": ["8.6"], | ||
| "8.5.0": ["8.7"], | ||
| "8.6.0": ["8.7"], |
Author
There was a problem hiding this comment.
not sure what to keep here to avoid breaking code - I tested it with 8.5.0 locally.
perhaps it would require a minor version bump to avoid breaking old code?
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.
Gradle 9 removed several deprecated APIs that this plugin relied on. This commit updates the plugin to use the new APIs and modernizes the build configuration to support the changes.
Replace
fileMode = 493withfilePermissions { unix("rwxr-xr-x") }The CopySpec.fileMode property was deprecated in Gradle 8 and removed in Gradle 9. The new filePermissions API provides the same functionality.Replace
project.exec {}with injectedExecOperations.exec {}The Project.exec() method was deprecated in Gradle 7.5 and removed in Gradle 9. Tasks must now use service injection to obtain ExecOperations. This requires changing task classes fromopen classtoabstract class.These changes are required because the new Gradle 9 APIs (filePermissions, ExecOperations) are only available in Gradle 8.3+, so we must compile against a newer Gradle version:
Gradle wrapper: 7.1.1 → 8.5 Required to compile against the new APIs (filePermissions added in 8.3)
Kotlin: 1.3.50 → 1.9.22 The old Kotlin Gradle plugin uses APIs removed in Gradle 8.x
AGP: 4.0.1 → 8.2.0 Required for Gradle 8.5+ compatibility
Java target: 1.8 → 17 Required by both Gradle 8.5+ and AGP 8.x
plugin-publish: 0.14.0 → 1.2.1 The old version uses the
pluginBundle {}DSL which was removed. Metadata (website, vcsUrl, tags) now goes ingradlePlugin {}block.Add Guava dependency Versions.groovy uses Guava collections which were previously provided transitively by AGP 4.x but are no longer included in AGP 8.x.
Add
nullbranch towhenexpression in CargoBuildTask Kotlin 1.7+ requires exhaustivewhenfor sealed classes with nullable types.Fixes #160