Skip to content

Commit

Permalink
Fix SimpleWorkResult deprecation warning in gradle 4.2
Browse files Browse the repository at this point in the history
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 GradleUp#326.
  • Loading branch information
REPLicated committed Sep 30, 2017
1 parent 5e89b3d commit 6ef2e3b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 6ef2e3b

Please sign in to comment.