Skip to content

Commit 90c856f

Browse files
committed
Clean output directory before extracting protos
If the dependencies change, the old dependency's proto files can be left around. That is broken and causes confusion. This was noticed in #731 when a `gradle clean` was needed.
1 parent ff4fe68 commit 90c856f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ abstract class ProtobufExtract extends DefaultTask {
8484

8585
@TaskAction
8686
public void extract() {
87+
copyActionFacade.delete { spec ->
88+
spec.delete(destDir)
89+
}
8790
copyActionFacade.copy { spec ->
8891
spec.includeEmptyDirs = false
8992
spec.from(inputProtoFiles)

0 commit comments

Comments
 (0)