From 5bfaa100f757d4a1342240270704903f0780cf77 Mon Sep 17 00:00:00 2001 From: Tyler Cook Date: Sat, 6 Nov 2021 11:01:53 -0500 Subject: [PATCH] Restrict getOutputSourceDirectorySet() to directories only --- .../google/protobuf/gradle/GenerateProtoTask.groovy | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/google/protobuf/gradle/GenerateProtoTask.groovy b/src/main/groovy/com/google/protobuf/gradle/GenerateProtoTask.groovy index 0cf3a714..b51e6d6f 100644 --- a/src/main/groovy/com/google/protobuf/gradle/GenerateProtoTask.groovy +++ b/src/main/groovy/com/google/protobuf/gradle/GenerateProtoTask.groovy @@ -542,10 +542,16 @@ public abstract class GenerateProtoTask extends DefaultTask { SourceDirectorySet srcSet srcSet = objectFactory.sourceDirectorySet(srcSetName, srcSetName) builtins.each { builtin -> - srcSet.srcDir new File(getOutputDir(builtin)) + File dir = new File(getOutputDir(builtin)) + if (!dir.name.endsWith(".zip") && !dir.name.endsWith(".jar")) { + srcSet.srcDir dir + } } plugins.each { plugin -> - srcSet.srcDir new File(getOutputDir(plugin)) + File dir = new File(getOutputDir(plugin)) + if (!dir.name.endsWith(".zip") && !dir.name.endsWith(".jar")) { + srcSet.srcDir dir + } } return srcSet }