-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor GenerateProtoTask's inputs (#291)
Previously, proto source files (that will be compiled by protoc) are added via inputs.files() (in Utils#addFilesToTaskInputs, and "include" directories (that include protos that may be "imported" but will not be compiled) are added via inputs.dir() (ProtobufPlugin.groovy:400). It has resulted in desired effect, that the only the former is included in the source files returned by inputs.sourceFiles (GenerateProtoTask.groovy:425) that are passed to protoc. However, this difference between files() and dir() is not mentioned on Gradle TaskInputs API. Instead of relying on a behavior that is undocumented and may change without notice, I refactored the inputs of the task to call out the two inputs explicitly as custom fields includeDirs and sourceFiles, and use inputs from the base class only for registering up-to-date checks. Also make sure the include dirs exist, because protoc would print a warning if a directory passed to -I doesn't exist.
- Loading branch information
1 parent
8d0b8db
commit 7123080
Showing
4 changed files
with
56 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters