From 6ef2e3b3d25390111e780b2bfda4a0d6ea51b120 Mon Sep 17 00:00:00 2001 From: Raphael Fuchs Date: Sat, 30 Sep 2017 16:11:03 +0200 Subject: [PATCH] Fix SimpleWorkResult deprecation warning in gradle 4.2 Explicitly silences deprecation warning regarding SimpleWorkResult. Since the recommended WorkResults appeared in 4.2, we can use this workaround to both avoid this warning in newer gradle versions and still support pre-4.2 for now. Closes #326. --- .../gradle/plugins/shadow/tasks/ShadowCopyAction.groovy | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 157f3acd4..91718e99b 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 @@ -31,6 +31,7 @@ import org.gradle.api.tasks.WorkResult import org.gradle.api.tasks.bundling.Zip import org.gradle.api.tasks.util.PatternSet import org.gradle.internal.UncheckedException +import org.gradle.util.DeprecationLogger import org.objectweb.asm.ClassReader import org.objectweb.asm.ClassVisitor import org.objectweb.asm.ClassWriter @@ -96,7 +97,12 @@ class ShadowCopyAction implements CopyAction { ) } } - return new SimpleWorkResult(true) + + WorkResult result = null + DeprecationLogger.whileDisabled { + result = new SimpleWorkResult(true) + } + return result } private void processTransformers(ZipOutputStream stream) {