From cc0e513dc81f026f87d2730bbad94337027b3d2b Mon Sep 17 00:00:00 2001 From: Jeff Alder <49817386+jeffalder@users.noreply.github.com> Date: Fri, 1 Nov 2019 07:42:02 -0700 Subject: [PATCH] #525: Remap MRJar classes correctly --- .../gradle/plugins/shadow/tasks/ShadowCopyAction.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.groovy index d42b3ee34..1ad4f4b50 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowCopyAction.groovy @@ -353,8 +353,10 @@ class ShadowCopyAction implements CopyAction { byte[] renamedClass = cw.toByteArray() - // Need to take the .class off for remapping evaluation - String mappedName = remapper.mapPath(path) + // Temporarily remove the multi-release prefix. + String multiReleasePrefix = path.find("^META-INF/versions/\\d+/") ?: "" + path = path.replace(multiReleasePrefix, "") + String mappedName = multiReleasePrefix + remapper.mapPath(path) InputStream bis = new ByteArrayInputStream(renamedClass) try {