Skip to content

Support skipping string constant remapping #1401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jul 23, 2025
Merged

Conversation

Goooler
Copy link
Member

@Goooler Goooler commented Apr 16, 2025

@Goooler Goooler force-pushed the g/22050416/fix-issue-232 branch from 6e070d3 to 7ab3258 Compare April 16, 2025 06:55
Goooler added 2 commits April 17, 2025 18:14
# Conflicts:
#	src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt
@Goooler Goooler force-pushed the g/22050416/fix-issue-232 branch from ad4a70a to de55c7b Compare April 17, 2025 10:21
@Goooler Goooler marked this pull request as ready for review April 23, 2025 09:37
@Goooler Goooler requested a review from Copilot April 24, 2025 03:01
Copilot

This comment was marked as outdated.

@Goooler Goooler requested a review from Copilot July 14, 2025 08:12
Copilot

This comment was marked as outdated.

@Goooler Goooler force-pushed the g/22050416/fix-issue-232 branch from bab7138 to 7953783 Compare July 23, 2025 07:49
@Goooler Goooler requested a review from Copilot July 23, 2025 07:50
Copy link
Contributor

@Copilot Copilot AI left a comment

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 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 skipStringConstants property to Relocator interface with default value of false
  • Implemented the property in SimpleRelocator with support in constructor, equals, and hashCode methods
  • Updated relocation logic in RelocatorRemapper to respect the skipStringConstants flag

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

@Goooler Goooler enabled auto-merge (squash) July 23, 2025 08:17
@Goooler Goooler disabled auto-merge July 23, 2025 08:18
@Goooler Goooler changed the title Support disabling of string constant remapping Support skipping string constant remapping Jul 23, 2025
@Goooler Goooler enabled auto-merge (squash) July 23, 2025 08:20
@Goooler Goooler merged commit 5ed4e83 into main Jul 23, 2025
13 checks passed
@Goooler Goooler deleted the g/22050416/fix-issue-232 branch July 23, 2025 08:29
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.

Improperly rewrites inside switch case statements The plugin changes constants with values similar to package names
1 participant