Support skipping string constant remapping#1401
Merged
Conversation
6e070d3 to
7ab3258
Compare
5042c45 to
233e9e0
Compare
This was referenced Apr 17, 2025
Closed
# Conflicts: # src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt
ad4a70a to
de55c7b
Compare
# Conflicts: # api/shadow.api # docs/changes/README.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bab7138 to
7953783
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for disabling string constant remapping during relocation by introducing a new skipStringConstants property to the Relocator interface. This feature allows users to prevent string literals from being relocated when they only want class and package names to be relocated.
- Added
skipStringConstantsproperty toRelocatorinterface with default value offalse - Implemented the property in
SimpleRelocatorwith support in constructor, equals, and hashCode methods - Updated relocation logic in
RelocatorRemapperto respect theskipStringConstantsflag
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Relocator.kt | Added skipStringConstants property to interface with default implementation |
| SimpleRelocator.kt | Implemented skipStringConstants property with constructor parameter and equality support |
| RelocatorRemapper.kt | Updated mapping logic to conditionally skip string constant relocation |
| RelocationTest.kt | Added parameterized test to verify string constant skipping functionality |
| README.md | Added documentation section explaining the new string constant skipping feature |
| README.md (changes) | Updated changelog with the new feature |
| shadow.api | Updated API signature file to reflect new method signatures |
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/RelocatorRemapper.kt
Show resolved
Hide resolved
…ernal/RelocatorRemapper.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…adow/internal/RelocatorRemapper.kt" This reverts commit d5060b1.
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.
Uh oh!
There was an error while loading. Please reload this page.