gRPC-java代码生成器
- gRPC-java的代码生成器编译需要先编译protobuf,否则会报c++源文件无法找到的错误
- 如果只是编译gRPC,而不打算编译代码生成器,可以使用下面的方法解决(详情请移步官方讨论组):
If you are just going to build gRPC and try the examples, you can create the file "gradle.properties" under the project's root directory and add "skipCodegen=true" to it. This will skip the code generation.
(来自讨论组)
grpc-java has a C++ code generation plugin for protoc. Since many Java developers don't have C compilers installed and don't need to modify the codegen, the build can skip it. To skip, create the file
<project-root>/gradle.properties
and addskipCodegen=true
(来自项目说明)
.
编译
cd $path_to_prj
./gradlew build
./gradlew install