Skip to content
Snippets Groups Projects
Commit d0442812 authored by Muxi Yan's avatar Muxi Yan
Browse files

Revert the changes to maintain backward compatibility

parent 7352bae1
No related branches found
No related tags found
No related merge requests found
...@@ -46,13 +46,8 @@ using ::grpc::protobuf::FileDescriptor; ...@@ -46,13 +46,8 @@ using ::grpc::protobuf::FileDescriptor;
using ::grpc::protobuf::ServiceDescriptor; using ::grpc::protobuf::ServiceDescriptor;
using ::grpc::string; using ::grpc::string;
inline string MessageHeaderName(const FileDescriptor *file, inline string MessageHeaderName(const FileDescriptor *file) {
bool dash_as_separator) { return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h";
if (dash_as_separator) {
return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h";
} else {
return grpc_generator::FileNameInUpperCamel(file) + ".pbobjc.h";
}
} }
inline string ServiceClassName(const ServiceDescriptor *service) { inline string ServiceClassName(const ServiceDescriptor *service) {
......
...@@ -32,10 +32,6 @@ ...@@ -32,10 +32,6 @@
*/ */
// Generates Objective C gRPC service interface out of Protobuf IDL. // Generates Objective C gRPC service interface out of Protobuf IDL.
// For legacy reason, output filename of this plugin is by default in uppercamel
// case with dash "-" treated as character and preserved in the output file
// name. If normal upper camel case (dash treated as word separator) is desired,
// use plugin option "filename-dash-as-separator".
#include <memory> #include <memory>
...@@ -63,17 +59,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { ...@@ -63,17 +59,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
return true; return true;
} }
::grpc::string file_name; ::grpc::string file_name =
google::protobuf::compiler::objectivec::FilePath(file);
// Simple parameter parsing as we have only one parameter.
// TODO(mxyan): Complete parameter parsing.
bool dash_as_separator =
(0 == parameter.compare("filename-dash-as-separator"));
if (dash_as_separator) {
file_name = google::protobuf::compiler::objectivec::FilePath(file);
} else {
file_name = grpc_generator::FileNameInUpperCamel(file);
}
::grpc::string prefix = file->options().objc_class_prefix(); ::grpc::string prefix = file->options().objc_class_prefix();
{ {
...@@ -90,8 +77,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { ...@@ -90,8 +77,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
// and import the files in the .pbrpc.m // and import the files in the .pbrpc.m
::grpc::string proto_imports; ::grpc::string proto_imports;
for (int i = 0; i < file->dependency_count(); i++) { for (int i = 0; i < file->dependency_count(); i++) {
::grpc::string header = grpc_objective_c_generator::MessageHeaderName( ::grpc::string header =
file->dependency(i), dash_as_separator); grpc_objective_c_generator::MessageHeaderName(file->dependency(i));
const grpc::protobuf::FileDescriptor *dependency = file->dependency(i); const grpc::protobuf::FileDescriptor *dependency = file->dependency(i);
if (IsProtobufLibraryBundledProtoFile(dependency)) { if (IsProtobufLibraryBundledProtoFile(dependency)) {
::grpc::string base_name = header; ::grpc::string base_name = header;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment