michaeledgar / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
0 stars 0 forks source link

How to specify search path for import statement? #137

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I need the same functionality that provided by protoc.exe. There is key 
--proto_path that allow to specify additional paths in which to search for 
imports.

I didn't find the way how do it. If I missed smth, can you provide me 
information how can I do it?

Original issue reported on code.google.com by mifena...@gmail.com on 2 Nov 2010 at 8:28

GoogleCodeExporter commented 9 years ago
*Currently* it searches relative to the current directory only. This would 
require a code change.

Original comment by marc.gravell on 2 Nov 2010 at 8:36

GoogleCodeExporter commented 9 years ago
I would also really like this as well. Not being able to reference .proto files 
in different directories makes code generation somewhat cumbersome. The 
attached patch touches protogen.exe to accept the -s option which is then 
passed straight through to protoc as --proto_path.

Also, since I'm using the VS code generator, ProtobufGenerator is touched to 
accept a path in the namespace field before the other options using a format 
such as:

;-s=../MyProtoDir;-s=..;observable

Quite frankly this is ugly as sin, but should be backwards compatible with 
previous users of the tool, and might allow one to hobble by until there is a 
better option available.

Original comment by thad.tho...@gmail.com on 13 Dec 2010 at 10:04

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks; as you note, the VS tooling doesn't give many options here... maybe 
long term I could look at a separate implicit config file of some kind (twinned 
with the .proto). Who knows. Right now my focus is getting v2 stable and RC, 
then I can improve the existing tooling.

Original comment by marc.gravell on 14 Dec 2010 at 9:33

GoogleCodeExporter commented 9 years ago
Any movement on this issue?

Original comment by evan.wat...@gmail.com on 5 Dec 2011 at 12:46