Refined edge case checks + added comments

pull/19733/head
Tony Lu 6 years ago
parent 6172ef8bd6
commit 6b24df2945
  1. 3
      src/compiler/objective_c_generator_helpers.h
  2. 6
      src/compiler/objective_c_plugin.cc
  3. 3
      src/objective-c/examples/InterceptorSample/Podfile
  4. 5
      src/objective-c/examples/RemoteTestClient/RemoteTest.podspec
  5. 3
      src/objective-c/examples/Sample/Podfile

@ -19,9 +19,6 @@
#ifndef GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H
#define GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H
#include <iostream>
using namespace std;
#include <map>
#include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h"

@ -88,7 +88,11 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
std::vector<::grpc::string> param =
grpc_generator::tokenize(*param_str, "=");
if (param[0] == "generate_for_named_framework") {
if (param[1].empty()) {
if (param.size() != 2) {
*error =
grpc::string("Format: generate_for_named_framework=<Framework>");
return false;
} else if (param[1].empty()) {
*error = grpc::string(
"Name of framework cannot be empty for parameter: ") +
param[0];

@ -2,6 +2,9 @@ platform :ios, '8.0'
install! 'cocoapods', :deterministic_uuids => false
# Default to use framework, so that providing no 'FRAMEWORK' env parameter works consistently
# for all Samples, specifically because Swift only supports framework.
# Only effective for examples/
use_frameworks! if ENV['FRAMEWORKS'] != 'NO'
ROOT_DIR = '../../../..'

@ -19,10 +19,13 @@ Pod::Spec.new do |s|
protoc = "#{bin_dir}/protobuf/protoc"
well_known_types_dir = "#{repo_root}/third_party/protobuf/src"
plugin = "#{bin_dir}/grpc_objective_c_plugin"
# Since we switched to importing full path, -I needs to be set to the directory
# from which the imported file can be found, which is the grpc's root here
if ENV['FRAMEWORKS'] != 'NO' then
s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'USE_FRAMEWORKS=1' }
s.prepare_command = <<-CMD
# Cannot find file if using *.proto. Maybe files' paths must match the -I flags
#{protoc} \
--plugin=protoc-gen-grpc=#{plugin} \
--objc_out=. \

@ -3,6 +3,9 @@ platform :ios, '8.0'
install! 'cocoapods', :deterministic_uuids => false
# Default to use framework, so that providing no 'FRAMEWORK' env parameter works consistently
# for all Samples, specifically because Swift only supports framework.
# Only effective for examples/
use_frameworks! if ENV['FRAMEWORKS'] != 'NO'
# Location of gRPC's repo root relative to this file.

Loading…
Cancel
Save