-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lint/Format fails with protobuf-gradle-plugin protobuf dependencies #132
Comments
Oddly, I see a test that seems to specifically cover this case -- I did some digging and the tests appear to run with protobuf-gradle-plugin version |
Addresses issue [132](#132) Fix buf tasks behavior with more recent versions of the `protobuf-gradle-plugin`. With version `0.9.3` (and possibly all `0.9.*` versions), the buf plugin tasks no longer work when `protobuf` dependencies are used (as described in the issue). This change filters the hard-coded "extracted" directories from the list of proto source directories set by the protobuf gradle plugin. Tested by: - Updating the test protobuf gradle plugin version to `0.9.3`. - Verifying tests fail when using protobuf dependencies. - Adding the extracted directory filter and verifying tests begin to pass. --------- Co-authored-by: Sean Chen <[email protected]> Co-authored-by: Andrew Parmet <[email protected]>
Just a note for the future - The fix to this issue will cause future versions of the plugin to stop working with |
Buf + protobuf-gradle-plugin seems to work great if all dependencies are of type
implementation
. The result is that thebufBuild
subdirectory of thebuild
directory contains the following:However, if the project has dependencies of type
protobuf
(described here), the buf* tasks don't appear to work. In this situation, thebufBuild
subdirectory contains the following:The buf tasks fail/appear wrong for what appears to be the following reasons:
buf
command isbuild-extracted--protos-main
, whereas in theimplementation
only case, the input directory is the project source.If I go in and delete the duplicate entry for the
buf.work.yaml
and manually run the command printed when I run the gradle task with the--info
task, the wrong protos end up being processed -- those from the dependencies, instead of those from the project source.The correct behavior would seem to be:
buf.work.yaml
only contains unique entriesbuf
command specified the project source directory.My minor hunch is that
protobuf-gradle-plugin
includesextracted-protos
inproject.srcProtoDirs
, which is resulting in both of the above behaviors. I think filteringextracted-protos
fromproject.srcProtoDirs
would address both issues.The text was updated successfully, but these errors were encountered: