Allow configuring the final R8 configuration file with R8Spec.configurationFile - #2133
Merged
Conversation
Goooler
marked this pull request as ready for review
July 30, 2026 01:33
Goooler
force-pushed
the
g/20260729/pg-conf-file
branch
from
July 30, 2026 01:56
7a84839 to
01b5419
Compare
R8Spec.configurationFileR8Spec.configurationFile
Goooler
commented
Jul 30, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new R8Spec.configurationFile property to control where R8 writes the final/collective ProGuard configuration (via --pg-conf-output), and updates the R8 rules generation so relative report paths can be resolved from the chosen configuration file directory.
Changes:
- Add
R8Spec.configurationFile(defaulting tobuild/shadowJar/r8/configuration.txt) and wire it into R8 execution. - Prepend a
-basedirectoryrule derived fromconfigurationFile’s directory to influence how R8 resolves relative report paths. - Add/extend unit + functional tests, and update docs/changelog/API surface.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/MinimizeSpecsTest.kt | Adds coverage for the new default configurationFile convention. |
| src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/R8Spec.kt | Introduces the new configurationFile property on the public R8 DSL/API. |
| src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/R8Minimizer.kt | Passes --pg-conf-output and injects -basedirectory into generated rules. |
| src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/DefaultR8Spec.kt | Sets the default convention for configurationFile under build/shadowJar/r8/. |
| src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/MinimizeTest.kt | Adds functional tests validating configuration output content and report path behavior. |
| docs/configuration/minimizing/README.md | Documents configurationFile and how R8 report paths resolve relative to it. |
| docs/changes/README.md | Adds an Unreleased changelog entry for R8Spec.configurationFile. |
| api/shadow.api | Updates the public API signature to include getConfigurationFile(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Closes #2128.