Skip to content

Commit

Permalink
Failing test case for generate proto task source files should include…
Browse files Browse the repository at this point in the history
… only *.proto files

See: google#620
  • Loading branch information
rougsig committed Oct 7, 2022
1 parent 24e9ab0 commit 4f95b10
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ class ProtobufJavaPluginTest extends Specification {
assert project.tasks.extractTestProto instanceof ProtobufExtract
}

void "test generate proto task sources should include only *.proto files"() {
given: "a project with readme file in proto source directory"
Project project = setupBasicProject()
project.file("src/main/proto").mkdirs()
project.file("src/main/proto/messages.proto") << "syntax = \"proto3\";"
project.file("src/main/proto/README.md") << "Hello World"

when: "project evaluated"
project.evaluate()

then: "it contains only *.proto files"
assert Objects.equals(
project.tasks.generateProto.sourceDirs.asFileTree.files,
[project.file("src/main/proto/messages.proto")] as Set<File>
)
}

void "testCustom sourceSet should get its own GenerateProtoTask"() {
given: "a basic project with java and com.google.protobuf"
Project project = setupBasicProject()
Expand Down

0 comments on commit 4f95b10

Please sign in to comment.