Skip to content

Allow configuring the final R8 configuration file with R8Spec.configurationFile - #2133

Merged
Goooler merged 17 commits into
mainfrom
g/20260729/pg-conf-file
Jul 30, 2026
Merged

Allow configuring the final R8 configuration file with R8Spec.configurationFile#2133
Goooler merged 17 commits into
mainfrom
g/20260729/pg-conf-file

Conversation

@Goooler

@Goooler Goooler commented Jul 29, 2026

Copy link
Copy Markdown
Member

Closes #2128.


  • CHANGELOG's "Unreleased" section has been updated, if applicable.

@Goooler
Goooler marked this pull request as ready for review July 30, 2026 01:33
@Goooler
Goooler force-pushed the g/20260729/pg-conf-file branch from 7a84839 to 01b5419 Compare July 30, 2026 01:56
@Goooler Goooler changed the title Allow configuring the final R8 ProGuard configuration file with R8Spec.configurationFile Allow configuring the final R8 configuration file with R8Spec.configurationFile Jul 30, 2026

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.

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 to build/shadowJar/r8/configuration.txt) and wire it into R8 execution.
  • Prepend a -basedirectory rule derived from configurationFile’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.

@Goooler
Goooler merged commit 8937e2a into main Jul 30, 2026
9 checks passed
@Goooler
Goooler deleted the g/20260729/pg-conf-file branch July 30, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support R8/ProGuard output reports

2 participants