gRPC-java代碼生成器
- gRPC-java的代碼生成器編譯需要先編譯protobuf,否則會(huì)報(bào)c++源文件無法找到的錯(cuò)誤
- 如果只是編譯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.propertiesand addskipCodegen=true
(來自項(xiàng)目說明)
.
編譯
cd $path_to_prj
./gradlew build
./gradlew install