My bash script has the following code generate invocation for "Protocol Buffers".
protoc --proto_path=src --java_out=src
src/com/domain/project/persistentThing.proto
That was from 2012. Today the online documentation for Java Protocol Buffers says:
protoc -I=$SRC_DIR --java_out=$DST_DIR
$SRC_DIR/addressbook.proto
This makes it seem like --proto_path is superceded. What was the purpose of --proto_path?
-I and --proto_path are the same flag: -I is the shorthand version.
The purpose of the flag is to specify a directory in which to look for imported files, much like the C compiler's -I flag, Java's CLASSPATH environment variable, Python's PYTHONPATH, etc. You may specify multiple directories by passing multiple -I flags; they will be searched in order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With