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

specify include path to resolve imported file #474

Closed
wants to merge 1 commit into from

Conversation

umegaya
Copy link

@umegaya umegaya commented Sep 29, 2016

this pull request aims to add functionality to specify include path to resolve imported proto file, stated in #368

include path can be specified via Builder object like following:

var builder = ProtoBuf.newBuilder({
    includePath:[
        './proto'
    ]
});
var protoBuilder = ProtoBuf.loadProtoFile('./proto/foo.proto', builder);

I know you don't want to support resolving path so much, but its kind of "nice to have" feature, right?

@aidansteele
Copy link

This would be very useful for the pbjs CLI tool. I would like to be able to pass in multiple paths, e.g. pbjs -p . -p /usr/local/opt/protobuf/include file.proto and have it able to import both my proto definitions and Google's definitions bundled with protoc.

@umegaya
Copy link
Author

umegaya commented Nov 2, 2016

@aidansteele thank you for your suggestion! but it means all .proto files need to convert to .json file once, and program loads them rite? if so, I think loading .proto directly is more handy way, if purpose is running tool. especially we have a lot of .proto files like this. I wonder why protobuf.js itself does not support this.

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

Successfully merging this pull request may close these issues.

None yet

3 participants