On Mon, Sep 25, 2017 at 5:21 AM, Andrew Pashkin <[email protected]>
wrote:

> Hello, everyone,
>
> I have a case where I need to read non-Protobuf files that are referenced
> from a target proto-file by a relative path. I use this approach to embed
> some information in a language different than Protobuf.  It seems like
> Protoc plugins only have access to the path of target proto-files relative
> to one of the directories provided using --proto_path command-line
> options of protoc.  And I'm trying to find a way to locate the target
> proto-file on the disk and with that locate the other files referenced from
> it by relative paths. Does anybody know a way how to do that?
>
This is not possible. If you look at the protoc-plugin protocol message, it
contains only the processed FileDescriptorProto without any original file
paths:
https://github.com/google/protobuf/blob/master/src/google/protobuf/compiler/plugin.proto#L90

Most people embed additional info in .proto files using custom options. I
think you can do the same .

> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to