From 28888fcadbac1ef514af0353ec6566c35cac57c3 Mon Sep 17 00:00:00 2001 From: zinking Date: Sat, 9 Jul 2022 21:14:07 +0800 Subject: [PATCH 1/5] support exclude source path in relocation --- .gitignore | 1 + .../shadow/impl/RelocatorRemapper.groovy | 20 +++++++++- .../shadow/relocation/Relocator.groovy | 2 + .../shadow/relocation/SimpleRelocator.groovy | 37 ++++++++++++++++++- .../shadow/tasks/ShadowCopyAction.groovy | 1 + .../relocation/SimpleRelocatorTest.groovy | 15 ++++++++ 6 files changed, 73 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c7be03627..745a5b52d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ yarn-error.log src/docs/.vuepress/dist/ .DS_Store jd-gui.cfg +lib/ diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy index b994463d1..fd912cbdd 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy @@ -24,6 +24,7 @@ import com.github.jengelman.gradle.plugins.shadow.relocation.RelocateClassContex import com.github.jengelman.gradle.plugins.shadow.relocation.RelocatePathContext import com.github.jengelman.gradle.plugins.shadow.relocation.Relocator import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowCopyAction.RelativeArchivePath +import groovy.util.logging.Slf4j import org.objectweb.asm.commons.Remapper import java.util.regex.Matcher @@ -34,12 +35,14 @@ import java.util.regex.Pattern * * @author John Engelman */ +@Slf4j class RelocatorRemapper extends Remapper { private final Pattern classPattern = Pattern.compile("(\\[*)?L(.+)") List relocators ShadowStats stats + public String currentFilePath RelocatorRemapper(List relocators, ShadowStats stats) { this.relocators = relocators @@ -65,7 +68,14 @@ class RelocatorRemapper extends Remapper { name = m.group(2) } - for (Relocator r : relocators) { + for (Relocator r : relocators) { + boolean canRelocate = r.canRelocateSourceFile(currentFilePath) + if (!canRelocate) { + String info = String.format("skipped %s as src path %s excluded", r, currentFilePath) + println(info) + log.info(info) + continue + } if (r.canRelocateClass(name)) { RelocateClassContext classContext = RelocateClassContext.builder().className(name).stats(stats).build() value = prefix + r.relocateClass(classContext) + suffix @@ -97,6 +107,14 @@ class RelocatorRemapper extends Remapper { } for (Relocator r : relocators) { + boolean canRelocate = r.canRelocateSourceFile(currentFilePath) + if (!canRelocate) { + String info = String.format("skipped %s as src path %s excluded", r, currentFilePath) + println(info) + log.info(info) + continue + } + if (r.canRelocatePath(name)) { RelocatePathContext pathContext = RelocatePathContext.builder().path(name).stats(stats).build() value = prefix + r.relocatePath(pathContext) + suffix diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/Relocator.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/Relocator.groovy index d9cb1d48f..b95e1cc4a 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/Relocator.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/Relocator.groovy @@ -37,4 +37,6 @@ interface Relocator { String relocateClass(RelocateClassContext context) String applyToSourceContent(String sourceContent) + + boolean canRelocateSourceFile(String sourceFilePath) } diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy index acc3cb13d..2f10309b3 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy @@ -45,6 +45,8 @@ class SimpleRelocator implements Relocator { private final Set includes private final Set excludes + + private final Set excludeSources private final boolean rawString @@ -53,11 +55,11 @@ class SimpleRelocator implements Relocator { } SimpleRelocator(String patt, String shadedPattern, List includes, List excludes) { - this(patt, shadedPattern, includes, excludes, false) + this(patt, shadedPattern, includes, excludes, [], false) } SimpleRelocator(String patt, String shadedPattern, List includes, List excludes, - boolean rawString) { + List excludeSources, boolean rawString) { this.rawString = rawString if (rawString) { @@ -86,6 +88,7 @@ class SimpleRelocator implements Relocator { this.includes = normalizePatterns(includes) this.excludes = normalizePatterns(excludes) + this.excludeSources = normalizePatterns(excludeSources) } SimpleRelocator include(String pattern) { @@ -98,6 +101,11 @@ class SimpleRelocator implements Relocator { return this } + SimpleRelocator excludeSource(String pattern) { + this.excludeSources.addAll normalizePatterns([pattern]) + return this + } + private static Set normalizePatterns(Collection patterns) { Set normalized = null @@ -148,6 +156,17 @@ class SimpleRelocator implements Relocator { return false } + private boolean isExcludedSource(String srPath) { + if (srPath != null && excludeSources != null && !excludeSources.isEmpty()) { + for (String excludeSource : excludeSources) { + if (srPath.startsWith(excludeSource)) { + return true + } + } + } + return false + } + boolean canRelocatePath(String path) { if (rawString) { return Pattern.compile(pathPattern).matcher(path).find() @@ -181,6 +200,10 @@ class SimpleRelocator implements Relocator { canRelocatePath(className.replace('.', '/')) } + boolean canRelocateSourceFile(String sourceFilePath) { + return !isExcludedSource(sourceFilePath) + } + String relocatePath(RelocatePathContext context) { String path = context.path context.stats.relocate(pathPattern, shadedPathPattern) @@ -239,4 +262,14 @@ class SimpleRelocator implements Relocator { boolean getRawString() { return rawString } + + @Input + Set getExcludeSources() { + return excludeSources + } + + @Override + public String toString() { + return String.format("Relocate[%s->%s][%s]", pattern, shadedPattern, excludeSources) + } } 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 3b7747085..03cd9c705 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 @@ -348,6 +348,7 @@ class ShadowCopyAction implements CopyAction { // that use the constant pool to determine the dependencies of a class. ClassWriter cw = new ClassWriter(0) + remapper.currentFilePath = path ClassVisitor cv = new ClassRemapper(cw, remapper) try { diff --git a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.groovy b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.groovy index 2b42eb3da..9c4cb9229 100644 --- a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.groovy +++ b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.groovy @@ -42,6 +42,21 @@ class SimpleRelocatorTest extends TestCase { stats = new ShadowStats() } + void testIsExcludedSource() { + SimpleRelocator relocator + + println("hello") + relocator = new SimpleRelocator("org.foo", null, null, null) + relocator.excludeSource "org/apache/iceberg/spark/parquet" + relocator.excludeSource "org/apache/spark/sql/execution/datasources/parquet" + println(relocator) + + assertEquals(false, relocator.canRelocateSourceFile("org/apache/iceberg/spark/parquet/SparkNativeParquet.class")) + assertEquals(false, relocator.canRelocateSourceFile("org/apache/iceberg/spark/parquet/SparkNativeParquet\$.class")) + assertEquals(false, relocator.canRelocateSourceFile("org/apache/spark/sql/execution/datasources/parquet/v1.class")) + assertEquals(true, relocator.canRelocateSourceFile("org/foo/Class.class")) + } + void testCanRelocatePath() { SimpleRelocator relocator From c51f584f6f124dac5a11e59301b2b3d63c7476d0 Mon Sep 17 00:00:00 2001 From: zinking Date: Sat, 9 Jul 2022 21:21:42 +0800 Subject: [PATCH 2/5] support exclude source path in relocation --- .../gradle/plugins/shadow/impl/RelocatorRemapper.groovy | 6 ++---- .../gradle/plugins/shadow/relocation/SimpleRelocator.groovy | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy index fd912cbdd..92e2e2d68 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy @@ -72,8 +72,7 @@ class RelocatorRemapper extends Remapper { boolean canRelocate = r.canRelocateSourceFile(currentFilePath) if (!canRelocate) { String info = String.format("skipped %s as src path %s excluded", r, currentFilePath) - println(info) - log.info(info) + log.debug(info) continue } if (r.canRelocateClass(name)) { @@ -110,8 +109,7 @@ class RelocatorRemapper extends Remapper { boolean canRelocate = r.canRelocateSourceFile(currentFilePath) if (!canRelocate) { String info = String.format("skipped %s as src path %s excluded", r, currentFilePath) - println(info) - log.info(info) + log.debug(info) continue } diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy index 2f10309b3..d8ea6b481 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy @@ -156,10 +156,10 @@ class SimpleRelocator implements Relocator { return false } - private boolean isExcludedSource(String srPath) { - if (srPath != null && excludeSources != null && !excludeSources.isEmpty()) { + private boolean isExcludedSource(String srcPath) { + if (srcPath != null && excludeSources != null && !excludeSources.isEmpty()) { for (String excludeSource : excludeSources) { - if (srPath.startsWith(excludeSource)) { + if (srcPath.startsWith(excludeSource)) { return true } } From 5321f87e0267280ec7cea0f533930acdff6cae03 Mon Sep 17 00:00:00 2001 From: luneo7 Date: Wed, 11 Oct 2023 16:46:11 -0500 Subject: [PATCH 3/5] Add relocator source exclusion --- .../shadow/impl/RelocatorRemapper.groovy | 23 ++++++---- .../shadow/relocation/Relocator.groovy | 2 + .../shadow/relocation/SimpleRelocator.groovy | 42 ++++++++++++++++++- .../shadow/tasks/ShadowCopyAction.groovy | 3 ++ .../relocation/SimpleRelocatorTest.groovy | 26 ++++++++++++ 5 files changed, 87 insertions(+), 9 deletions(-) diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy index b994463d1..7703ad409 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy @@ -40,6 +40,7 @@ class RelocatorRemapper extends Remapper { List relocators ShadowStats stats + String currentFilePath RelocatorRemapper(List relocators, ShadowStats stats) { this.relocators = relocators @@ -66,14 +67,16 @@ class RelocatorRemapper extends Remapper { } for (Relocator r : relocators) { - if (r.canRelocateClass(name)) { - RelocateClassContext classContext = RelocateClassContext.builder().className(name).stats(stats).build() - value = prefix + r.relocateClass(classContext) + suffix - break - } else if (r.canRelocatePath(name)) { - RelocatePathContext pathContext = RelocatePathContext.builder().path(name).stats(stats).build() - value = prefix + r.relocatePath(pathContext) + suffix - break + if (r.canRelocateSourceFile(currentFilePath)) { + if (r.canRelocateClass(name)) { + RelocateClassContext classContext = RelocateClassContext.builder().className(name).stats(stats).build() + value = prefix + r.relocateClass(classContext) + suffix + break + } else if (r.canRelocatePath(name)) { + RelocatePathContext pathContext = RelocatePathContext.builder().path(name).stats(stats).build() + value = prefix + r.relocatePath(pathContext) + suffix + break + } } } @@ -115,4 +118,8 @@ class RelocatorRemapper extends Remapper { mapPath(path.pathString) } + void currentFilePath(String path) { + currentFilePath = path + } + } diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/Relocator.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/Relocator.groovy index d9cb1d48f..b95e1cc4a 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/Relocator.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/Relocator.groovy @@ -37,4 +37,6 @@ interface Relocator { String relocateClass(RelocateClassContext context) String applyToSourceContent(String sourceContent) + + boolean canRelocateSourceFile(String sourceFilePath) } diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy index 442eddbe3..d773ae634 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocator.groovy @@ -46,6 +46,8 @@ class SimpleRelocator implements Relocator { private final Set includes private final Set excludes + + private final Set excludeSources private final boolean rawString @@ -57,8 +59,12 @@ class SimpleRelocator implements Relocator { this(patt, shadedPattern, includes, excludes, false) } + SimpleRelocator(String patt, String shadedPattern, List includes, List excludes, boolean rawString) { + this(patt, shadedPattern, includes, excludes, [], rawString) + } + SimpleRelocator(String patt, String shadedPattern, List includes, List excludes, - boolean rawString) { + List excludeSources, boolean rawString) { this.rawString = rawString if (rawString) { @@ -87,6 +93,7 @@ class SimpleRelocator implements Relocator { this.includes = normalizePatterns(includes) this.excludes = normalizePatterns(excludes) + this.excludeSources = normalizePatterns(excludeSources) } SimpleRelocator include(String pattern) { @@ -99,6 +106,11 @@ class SimpleRelocator implements Relocator { return this } + SimpleRelocator excludeSource(String pattern) { + this.excludeSources.addAll normalizePatterns([pattern]) + return this + } + private static Set normalizePatterns(Collection patterns) { Set normalized = null @@ -149,6 +161,17 @@ class SimpleRelocator implements Relocator { return false } + private boolean isExcludedSource(String srcPath) { + if (excludeSources != null && !excludeSources.isEmpty() && srcPath != null) { + for (String excludeSource : excludeSources) { + if (SelectorUtils.matchPath(excludeSource, srcPath, '/', true)) { + return true + } + } + } + return false + } + boolean canRelocatePath(String path) { if (rawString) { return Pattern.compile(pathPattern).matcher(path).find() @@ -182,6 +205,18 @@ class SimpleRelocator implements Relocator { canRelocatePath(className.replace('.', '/')) } + boolean canRelocateSourceFile(String srcPath) { + 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) + } + + return !isExcludedSource(srcPath) + } + String relocatePath(RelocatePathContext context) { String path = context.path context.stats.relocate(pathPattern, shadedPathPattern) @@ -238,6 +273,11 @@ class SimpleRelocator implements Relocator { return excludes } + @Input + Set getExcludeSources() { + return excludeSources + } + @Input boolean getRawString() { return rawString 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 4c3f07142..a842cca98 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 @@ -345,6 +345,8 @@ class ShadowCopyAction implements CopyAction { // that use the constant pool to determine the dependencies of a class. ClassWriter cw = new ClassWriter(0) + remapper.currentFilePath(path) + ClassVisitor cv = new ClassRemapper(cw, remapper) try { @@ -353,6 +355,7 @@ class ShadowCopyAction implements CopyAction { throw new GradleException("Error in ASM processing class " + path, ise) } finally { is.close() + remapper.currentFilePath(null) } byte[] renamedClass = cw.toByteArray() diff --git a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.groovy b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.groovy index 2b42eb3da..e7268d0c2 100644 --- a/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.groovy +++ b/src/test/groovy/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.groovy @@ -42,6 +42,32 @@ class SimpleRelocatorTest extends TestCase { stats = new ShadowStats() } + void testCanRelocateSourceFile() { + SimpleRelocator relocator + + relocator = new SimpleRelocator("org.foo", null, null, null) + relocator.excludeSource "org/apache/iceberg/spark/parquet/**" + relocator.excludeSource "org/apache/spark/sql/execution/datasources/parquet/**" + + assertEquals(false, relocator.canRelocateSourceFile("org/apache/iceberg/spark/parquet/SparkNativeParquet.class")) + assertEquals(false, relocator.canRelocateSourceFile("org/apache/iceberg/spark/parquet/SparkNativeParquet\$.class")) + assertEquals(false, relocator.canRelocateSourceFile("org/apache/spark/sql/execution/datasources/parquet/v1.class")) + assertEquals(true, relocator.canRelocateSourceFile("org/foo/Class.class")) + } + + void testCanRelocateSourceFileWithRegex() { + SimpleRelocator relocator + + relocator = new SimpleRelocator("org.foo", null, null, null) + relocator.excludeSource "%regex[org/apache/iceberg/.*]" + relocator.excludeSource "%regex[org/apache/spark/.*]" + + assertEquals(false, relocator.canRelocateSourceFile("org/apache/iceberg/spark/parquet/SparkNativeParquet.class")) + assertEquals(false, relocator.canRelocateSourceFile("org/apache/iceberg/spark/parquet/SparkNativeParquet\$.class")) + assertEquals(false, relocator.canRelocateSourceFile("org/apache/spark/sql/execution/datasources/parquet/v1.class")) + assertEquals(true, relocator.canRelocateSourceFile("org/foo/Class.class")) + } + void testCanRelocatePath() { SimpleRelocator relocator From 899d7aea52e47bc31e7cddf5e953a233e9263f40 Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Thu, 19 Sep 2024 10:54:25 +0800 Subject: [PATCH 4/5] Update src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy --- .../shadow/impl/RelocatorRemapper.groovy | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy index 7703ad409..de13bda39 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy @@ -67,16 +67,16 @@ class RelocatorRemapper extends Remapper { } for (Relocator r : relocators) { - if (r.canRelocateSourceFile(currentFilePath)) { - if (r.canRelocateClass(name)) { - RelocateClassContext classContext = RelocateClassContext.builder().className(name).stats(stats).build() - value = prefix + r.relocateClass(classContext) + suffix - break - } else if (r.canRelocatePath(name)) { - RelocatePathContext pathContext = RelocatePathContext.builder().path(name).stats(stats).build() - value = prefix + r.relocatePath(pathContext) + suffix - break - } + if (!r.canRelocateSourceFile(currentFilePath)) continue + if (r.canRelocateClass(name)) { + RelocateClassContext classContext = RelocateClassContext.builder().className(name).stats(stats).build() + value = prefix + r.relocateClass(classContext) + suffix + break + } else if (r.canRelocatePath(name)) { + RelocatePathContext pathContext = RelocatePathContext.builder().path(name).stats(stats).build() + value = prefix + r.relocatePath(pathContext) + suffix + break + } } } From 005d95959494fa57e34b9573d242a76f6313507d Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Thu, 19 Sep 2024 10:58:03 +0800 Subject: [PATCH 5/5] Apply suggestions from code review --- .../gradle/plugins/shadow/impl/RelocatorRemapper.groovy | 5 ----- .../gradle/plugins/shadow/tasks/ShadowCopyAction.groovy | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy index de13bda39..46db0f13a 100644 --- a/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy +++ b/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/impl/RelocatorRemapper.groovy @@ -77,7 +77,6 @@ class RelocatorRemapper extends Remapper { value = prefix + r.relocatePath(pathContext) + suffix break } - } } return value @@ -118,8 +117,4 @@ class RelocatorRemapper extends Remapper { mapPath(path.pathString) } - void currentFilePath(String path) { - currentFilePath = path - } - } 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 4922b13ce..b0c2191c0 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 @@ -347,7 +347,7 @@ class ShadowCopyAction implements CopyAction { // that use the constant pool to determine the dependencies of a class. ClassWriter cw = new ClassWriter(0) - remapper.currentFilePath(path) + remapper.currentFilePath = path ClassVisitor cv = new ClassRemapper(cw, remapper) @@ -357,7 +357,7 @@ class ShadowCopyAction implements CopyAction { throw new GradleException("Error in ASM processing class " + path, ise) } finally { is.close() - remapper.currentFilePath(null) + remapper.currentFilePath = null } byte[] renamedClass = cw.toByteArray()