Skip to content

Commit

Permalink
Avoid duplicate GenerateProtoTask output dir (#703) (#718)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
YifeiZhuang and csv8674xn authored Jul 13, 2023
1 parent 1c33cad commit 30fa504
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@ public abstract class GenerateProtoTask extends DefaultTask {
@Internal
@PackageScope
Collection<File> getOutputSourceDirectories() {
Collection<File> srcDirs = []
// insertion point requires the same output source directories as the java plugin. Using a set to avoid duplication.
Collection<File> srcDirs = [] as Set
builtins.each { builtin ->
File dir = new File(getOutputDir(builtin))
if (!dir.name.endsWith(".zip") && !dir.name.endsWith(".jar")) {
Expand Down

0 comments on commit 30fa504

Please sign in to comment.