Skip to content

Add relocateText extensions - #2208

Merged
Goooler merged 1 commit into
g/20260817/add-trans-functionsfrom
g/20260819/relocate-all-text
Aug 19, 2026
Merged

Add relocateText extensions#2208
Goooler merged 1 commit into
g/20260817/add-trans-functionsfrom
g/20260819/relocate-all-text

Conversation

@Goooler

@Goooler Goooler commented Aug 19, 2026

Copy link
Copy Markdown
Member

No description provided.

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

Adds new relocateText extension(s) intended to support relocating class/package references embedded in arbitrary text (e.g., ProGuard/R8 rules), and updates the ProGuard rules transformer to use this new behavior.

Changes:

  • Introduces Relocator.relocateText(String) and Iterable<Relocator>.relocateText(String) extensions.
  • Updates ProGuardFilesResourceTransformer to relocate rule lines via relocateText.
  • Adds unit tests covering SimpleRelocator.relocateText and chained relocation behavior across multiple relocators.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/relocation/RelocationContext.kt Adds new relocateText extension APIs for single relocators and collections.
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ProGuardFilesResourceTransformer.kt Switches ProGuard/R8 rule line relocation to the new relocateText behavior.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.kt Adds tests for SimpleRelocator.relocateText behavior across several configurations.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/relocation/RelocatorsTest.kt Adds tests for chained and ordered text relocation across multiple relocators.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Goooler
Goooler changed the base branch from main to g/20260817/add-trans-functions August 19, 2026 08:56
@Goooler
Goooler merged commit 2de8490 into g/20260817/add-trans-functions Aug 19, 2026
7 checks passed
@Goooler
Goooler deleted the g/20260819/relocate-all-text branch August 19, 2026 09:06
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.

2 participants