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

Generating custom files in the same directory as protoc #20

Closed
SonarBeserk opened this issue Jun 4, 2018 · 1 comment
Closed

Generating custom files in the same directory as protoc #20

SonarBeserk opened this issue Jun 4, 2018 · 1 comment
Labels

Comments

@SonarBeserk
Copy link

I am working on a project that requires generating .ico files as well as text files. Previously I used AddGeneratorTemplateFile to generate from a template, however with the new utf-8 validation this is no longer possible. AddCustomTemplateFile allows the file to be generated but the issue is that it is generated in the wrong directory. The output path is constantly returned as "." regardless of what the protoc parameters are set to.

@rodaine
Copy link
Contributor

rodaine commented Jun 4, 2018

This is a limitation of protoc, where plugins are not given the output path from the execution (the value after the :). PG* supports setting a output_path param to override this behavior. So your protoc execution should look something like the following:

protoc \
  myplugin_out="output_path=${OUTPUT}:${OUTPUT}"\
  my_proto.proto

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

No branches or pull requests

2 participants