Skip to content

Commit

Permalink
Avoid duplicate GenerateProtoTask output dir (#703)
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`
  • Loading branch information
csv8674xn authored May 10, 2023
1 parent 6434c1d commit 96e23fa
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 96e23fa

Please sign in to comment.