Skip to content

Support disabling of 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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

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
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 in the Shadow plugin. The feature allows users to skip relocating string literals while still relocating class names and paths, which is useful when string constants should remain unchanged even when the referenced classes are relocated.

Key changes:

  • Added a new skipStringLiteral boolean property to the Relocator interface and SimpleRelocator implementation
  • Modified the remapping logic to conditionally skip string literal relocation based on this flag
  • Added comprehensive tests to verify the functionality works correctly

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/relocation/Relocator.kt Added skipStringLiteral property to the interface
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.kt Implemented skipStringLiteral property with proper equals/hashCode integration
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/RelocatorRemapper.kt Modified remapping logic to check skipStringLiteral flag before processing string literals
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt Added parameterized tests to verify string literal remapping can be disabled
docs/changes/README.md Updated changelog with the new feature
api/shadow.api Updated API definition with new property and constructor

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

The plugin changes constants with values similar to package names
1 participant