当前位置: 动力学知识库 > 问答 > 编程问答 >

java - What is the purpose of proto_path in the protoc command

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: