Skip to content
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

Support descriptor_set_in protoc option #251

Open
rbbrns opened this issue Jul 23, 2018 · 4 comments
Open

Support descriptor_set_in protoc option #251

rbbrns opened this issue Jul 23, 2018 · 4 comments

Comments

@rbbrns
Copy link

rbbrns commented Jul 23, 2018

--descriptor_set_in=FILES Specifies a delimited list of FILES
each containing a FileDescriptorSet (a
protocol buffer defined in descriptor.proto).
The FileDescriptor for each of the PROTO_FILES
provided will be loaded from these
FileDescriptorSets. If a FileDescriptor
appears multiple times, the first occurrence
will be used.

This option cannot be used with --protop_path: "Only one of --descriptor_set_in and --proto_path can be specified."

@zpencer
Copy link
Contributor

zpencer commented Jul 23, 2018

If the idea is to support both flags, the behavior is from the underlying protoc compiler, and the enhancement idea should be discussed there: protocolbuffers/protobuf#3973

Are you trying to use descriptor_set_in alone for the gradle plugin?

@zpencer zpencer closed this as completed Jul 23, 2018
@zpencer zpencer reopened this Jul 23, 2018
@rbbrns
Copy link
Author

rbbrns commented Jul 23, 2018

Sorry for not being more clear. I want to to be able to use descriptor_set_in from the gradle plugin. I was just documenting that descriptor_set_in and proto_path cannot be used together since it isn't clear from the descriptor_set_in documentation.

@tatemz
Copy link

tatemz commented Mar 31, 2020

I would much rather have this feature over copying my proto files across projects. Can we dig this issue back out of the 2018 Issue Graveyard? 😄

I have already started looking at the plugin source code but don't know gradle or groovy well enough to discern what types of changes to make.

I think we have to divide the problem into two parts:

  1. Optionally using descriptor files as a gradle source set

  2. When using descriptor sets, protoc still needs to know which files within the descriptor set to compile

    • This could be a string list 🤷‍♂️
    • Or this could be another source set, but if the source set is detected to be empty (which it would be when using a descriptor set), then the compile task is skipped (link).

Could really some suggestions from the repo owners on this one. 🙏

@friscoMad
Copy link

Any news on this?
It has been a long time and I see there was an attempt to add this in a PR 2 years ago, but seems that it was stalled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants