On Wed, Jul 3, 2013 at 6:59 PM, Motiejus Jakštys <desired....@gmail.com>wrote:

> Hi all,
>
> I am writing Python protoc plugin which wants to add some Python to
> resulting artifacts. However, there is an issue. For it to work I must
> do some acrobatics to get the file name in the plugin. The "name" of
> CodeGeneratorResponse().file must be non-empty, otherwise plugin will
> fail with this message:
>
> : Tried to insert into file that doesn't exist.
>
> Now I implemented a hack: I match the filename and guess the resulting
> output in the filename. Works for now, but not general enough.
>
I think what you are doing is correct. Your plugin needs to know what the
protocol compiler will generate for a proto file. When the protocol
compiler changes, your plugin should be updated accordingly. There isn't an
API for the plugin to query for the output file names.


>
> Is there a better way to get the being-generated filename in general
> case? Am I missing something in the protoc plugins API? Or is it safe?
>
> --
> Motiejus Jakštys
>
> --
> 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 protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to