Update grpc-java to 1.3.0, netty to 4.1.8.Final
Change-Id: I24e44ce87f5e042ddddb4cdbdcdd118a2d30a5eb
diff --git a/third_party/grpc/compiler/src/java_plugin/cpp/java_plugin.cpp b/third_party/grpc/compiler/src/java_plugin/cpp/java_plugin.cpp
index 5b4b190..72ead37 100644
--- a/third_party/grpc/compiler/src/java_plugin/cpp/java_plugin.cpp
+++ b/third_party/grpc/compiler/src/java_plugin/cpp/java_plugin.cpp
@@ -9,7 +9,6 @@
#include <google/protobuf/compiler/code_generator.h>
#include <google/protobuf/compiler/plugin.h>
#include <google/protobuf/descriptor.h>
-#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/io/zero_copy_stream.h>
static string JavaPackageToDir(const string& package_name) {
@@ -32,16 +31,20 @@
const string& parameter,
google::protobuf::compiler::GeneratorContext* context,
string* error) const {
- vector<pair<string, string> > options;
+ std::vector<std::pair<string, string> > options;
google::protobuf::compiler::ParseGeneratorParameter(parameter, &options);
java_grpc_generator::ProtoFlavor flavor =
java_grpc_generator::ProtoFlavor::NORMAL;
+
+ bool enable_deprecated = false;
for (int i = 0; i < options.size(); i++) {
if (options[i].first == "nano") {
flavor = java_grpc_generator::ProtoFlavor::NANO;
} else if (options[i].first == "lite") {
flavor = java_grpc_generator::ProtoFlavor::LITE;
+ } else if (options[i].first == "enable_deprecated") {
+ enable_deprecated = options[i].second == "true";
}
}
@@ -54,7 +57,7 @@
+ java_grpc_generator::ServiceClassName(service) + ".java";
std::unique_ptr<google::protobuf::io::ZeroCopyOutputStream> output(
context->Open(filename));
- java_grpc_generator::GenerateService(service, output.get(), flavor);
+ java_grpc_generator::GenerateService(service, output.get(), flavor, enable_deprecated);
}
return true;
}