-
Notifications
You must be signed in to change notification settings - Fork 274
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
Generated source folder should be registered on the SourceSet #474
Comments
This is kind of working as intended. Protobuf projects work in the way that APIs are exposed through protobuf definitions, so that consuming projects can import protos from dependencies to build their own proto APIs. Generated code is not the real source, but protos are. On the other hand, adding generated code into source sets automatically includes them Javadoc as generated classes are always public. This is generally not wanted (e.g., for gRPC-Java) given that proto sources are exposed as APIs.
Right, that's the better approach. There is a TODO item left in the code for migrating to |
Sure, I can do that. |
Fixes google#474 Signed-off-by: Stefan Oehme <[email protected]>
@oehme Sorry for reply on a closed issue, but I still encounter this issue with the patched version 0.8.16, see #493. Further, I'm also using antlr in my project, which has a build-in gradle plugin, and I found some difference between antlr and protobuf plugins. -For anltr, with the default configuration, such as
put -For protobuf, with the default configuration(I saw different demos in README, documents, example projects, etc. just pickup one of them), such as
put Thus, I found a workaround but only works on gradle 6.8, will failed on gradle 7.0 (see #493, mentioned at the begin)
-I know little on gradle internal, but from an user perspective, as that |
Sorry, I can't reproduce that. I've created a minimal protobuf project and the source directories are set up automatically on IDEA import. No additional configuration required. Please attach a reproducible example. |
@oehme thanks for the reply, it has been solved by #493 (comment) |
Yes and I just realized that the problem is reproducible when I remove the The problem is that the protobuf plugin eagerly checks for the idea plugin instead of using a callback. |
Instead of requiring users to apply the `idea` plugin, which is normally not necessary when using IDEA's importer. Fixes google#474
Instead of requiring users to apply the `idea` plugin, which is normally not necessary when using IDEA's importer. Fixes #474
The plugin currently registers its generated sources directly on the
JavaCompile
task. This is too low level and means that other plugins/tasks will not pick up on those generated sources. For example, they will be missing from the source jar.On top of that, it should integrate with the IDEA plugin and register that folder as a "generated" folder, so that it is correctly marked as generated in IDEA. That way, users are warned if they try to edit those files.
The text was updated successfully, but these errors were encountered: