Skip to content

Commit 30fa504

Browse files
Avoid duplicate GenerateProtoTask output dir (#703) (#718)
Remove duplicate output source dir that breaks in android in source jar task. When using the insertion point, custom plugin needs to use the same output directory as the code gen output directory from java/javalite. This causes other tasks to fail if it depends on the output source and duplicationStrategy is set to `DuplicatesStrategy.FAIL` Co-authored-by: Yao-Jung Yang <[email protected]>
1 parent 1c33cad commit 30fa504

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/groovy/com/google/protobuf/gradle/GenerateProtoTask.groovy

+2-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ public abstract class GenerateProtoTask extends DefaultTask {
571571
@Internal
572572
@PackageScope
573573
Collection<File> getOutputSourceDirectories() {
574-
Collection<File> srcDirs = []
574+
// insertion point requires the same output source directories as the java plugin. Using a set to avoid duplication.
575+
Collection<File> srcDirs = [] as Set
575576
builtins.each { builtin ->
576577
File dir = new File(getOutputDir(builtin))
577578
if (!dir.name.endsWith(".zip") && !dir.name.endsWith(".jar")) {

0 commit comments

Comments
 (0)