Skip to content

Commit

Permalink
Add quickfix for #620
Browse files Browse the repository at this point in the history
  • Loading branch information
rougsig committed Oct 7, 2022
1 parent 4f95b10 commit dbd52cb
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,11 @@ public abstract class GenerateProtoTask extends DefaultTask {

// Sort to ensure generated descriptors have a canonical representation
// to avoid triggering unnecessary rebuilds downstream
List<File> protoFiles = sourceDirs.asFileTree.files.sort()
List<File> protoFiles = sourceDirs.asFileTree
// quick fix for https://github.com/google/protobuf-gradle-plugin/issues/620
.filter { File it -> it.name.endsWith(".proto") }
.files
.sort()

[builtins, plugins]*.forEach { PluginOptions plugin ->
String outputPath = getOutputDir(plugin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.gradle.testfixtures.ProjectBuilder
import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.TaskOutcome
import spock.lang.Ignore
import spock.lang.Specification
import spock.lang.Unroll

Expand Down Expand Up @@ -35,6 +36,8 @@ class ProtobufJavaPluginTest extends Specification {
assert project.tasks.extractTestProto instanceof ProtobufExtract
}

// Do not forget add android test
@Ignore("enable in 0.10.0, good fix contains breaking api change, more info #621")
void "test generate proto task sources should include only *.proto files"() {
given: "a project with readme file in proto source directory"
Project project = setupBasicProject()
Expand Down
1 change: 1 addition & 0 deletions testProjectAndroidBase/src/main/proto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
1 change: 1 addition & 0 deletions testProjectAndroidBase/src/test/proto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
1 change: 1 addition & 0 deletions testProjectBase/src/main/proto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
1 change: 1 addition & 0 deletions testProjectBase/src/test/proto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World

0 comments on commit dbd52cb

Please sign in to comment.