Skip to content
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

Add relocator source exclusion #890

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

Conversation

luneo7
Copy link

@luneo7 luneo7 commented Oct 11, 2023

This is mostly #780 remade =]

We need the ability to exclude sources from being relocated as we have gradle subprojects being included in shaded jar that is being caught in one relocator rule that we don't want it to be relocated.

Closes #780.

# Conflicts:
#	src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy
#	src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy
#	src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.groovy
#	src/test/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.groovy
Comment on lines +209 to +214
if (srcPath != null && srcPath.endsWith(".class")) {
// Safeguard against strings containing only ".class"
if (srcPath.length() == 6) {
return false
}
srcPath = srcPath.substring(0, srcPath.length() - 6)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract .class to a const value and eliminate these magic numbers?

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.

3 participants