Used framework imports within generated stubs where necessary

pull/19733/head
Tony Lu 5 years ago
parent 3e4cdf20b0
commit 431c5306ba
  1. 12
      src/compiler/objective_c_generator_helpers.h
  2. 48
      src/compiler/objective_c_plugin.cc
  3. 58
      src/objective-c/examples/InterceptorSample/InterceptorSample.xcodeproj/project.pbxproj
  4. 5
      src/objective-c/examples/InterceptorSample/InterceptorSample/ViewController.m
  5. 2
      src/objective-c/examples/InterceptorSample/Podfile
  6. 19
      src/objective-c/examples/RemoteTestClient/RemoteTest.podspec
  7. 2
      src/objective-c/examples/Sample/Podfile
  8. 90
      src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj
  9. 5
      src/objective-c/examples/Sample/Sample/ViewController.m
  10. 30
      src/objective-c/examples/SwiftSample/Images.xcassets/AppIcon.appiconset/Contents.json
  11. 55
      src/objective-c/examples/SwiftSample/RemoteTest.podspec
  12. 50
      src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj
  13. 118
      src/objective-c/examples/SwiftSample/messages.proto
  14. 57
      src/objective-c/examples/SwiftSample/test.proto

@ -19,6 +19,10 @@
#ifndef GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H #ifndef GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H
#define 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 <map>
#include "src/compiler/config.h" #include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h" #include "src/compiler/generator_helpers.h"
@ -45,6 +49,14 @@ inline ::grpc::string LocalImport(const ::grpc::string& import) {
return ::grpc::string("#import \"" + import + "\"\n"); return ::grpc::string("#import \"" + import + "\"\n");
} }
inline ::grpc::string FrameworkImport(const ::grpc::string& import, const ::grpc::string& framework) {
// Flattens the directory structure
std::size_t pos = import.rfind("/");
::grpc::string filename = import.substr(pos + 1, import.size() - pos);
cerr << filename << endl;
return ::grpc::string("#import <" + framework + "/" + filename + ">\n");
}
inline ::grpc::string SystemImport(const ::grpc::string& import) { inline ::grpc::string SystemImport(const ::grpc::string& import) {
return ::grpc::string("#import <" + import + ">\n"); return ::grpc::string("#import <" + import + ">\n");
} }

@ -30,6 +30,7 @@ using ::google::protobuf::compiler::objectivec::
IsProtobufLibraryBundledProtoFile; IsProtobufLibraryBundledProtoFile;
using ::google::protobuf::compiler::objectivec::ProtobufLibraryFrameworkName; using ::google::protobuf::compiler::objectivec::ProtobufLibraryFrameworkName;
using ::grpc_objective_c_generator::LocalImport; using ::grpc_objective_c_generator::LocalImport;
using ::grpc_objective_c_generator::FrameworkImport;
using ::grpc_objective_c_generator::PreprocIfElse; using ::grpc_objective_c_generator::PreprocIfElse;
using ::grpc_objective_c_generator::PreprocIfNot; using ::grpc_objective_c_generator::PreprocIfNot;
using ::grpc_objective_c_generator::SystemImport; using ::grpc_objective_c_generator::SystemImport;
@ -37,11 +38,16 @@ using ::grpc_objective_c_generator::SystemImport;
namespace { namespace {
inline ::grpc::string ImportProtoHeaders( inline ::grpc::string ImportProtoHeaders(
const grpc::protobuf::FileDescriptor* dep, const char* indent) { const grpc::protobuf::FileDescriptor* dep, const char* indent, const ::grpc::string &framework) {
::grpc::string header = grpc_objective_c_generator::MessageHeaderName(dep); ::grpc::string header = grpc_objective_c_generator::MessageHeaderName(dep);
// cerr << header << endl;
if (!IsProtobufLibraryBundledProtoFile(dep)) { if (!IsProtobufLibraryBundledProtoFile(dep)) {
return indent + LocalImport(header); if (framework.empty()) {
return indent + LocalImport(header);
} else {
return indent + FrameworkImport(header, framework);
}
} }
::grpc::string base_name = header; ::grpc::string base_name = header;
@ -74,6 +80,15 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
return true; return true;
} }
::grpc::string framework;
std::vector<::grpc::string> params_list = grpc_generator::tokenize(parameter, ",");
for (auto param_str = params_list.begin(); param_str != params_list.end(); ++param_str) {
std::vector<::grpc::string> param = grpc_generator::tokenize(*param_str, "=");
if (param[0] == "generate_for_named_framework") {
framework = param[1];
}
}
static const ::grpc::string kNonNullBegin = "NS_ASSUME_NONNULL_BEGIN\n"; static const ::grpc::string kNonNullBegin = "NS_ASSUME_NONNULL_BEGIN\n";
static const ::grpc::string kNonNullEnd = "NS_ASSUME_NONNULL_END\n"; static const ::grpc::string kNonNullEnd = "NS_ASSUME_NONNULL_END\n";
static const ::grpc::string kProtocolOnly = "GPB_GRPC_PROTOCOL_ONLY"; static const ::grpc::string kProtocolOnly = "GPB_GRPC_PROTOCOL_ONLY";
@ -85,8 +100,13 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
{ {
// Generate .pbrpc.h // Generate .pbrpc.h
::grpc::string imports = LocalImport(file_name + ".pbobjc.h"); ::grpc::string imports;
if (framework.empty()) {
imports = LocalImport(file_name + ".pbobjc.h");
} else {
imports = FrameworkImport(file_name + ".pbobjc.h", framework);
}
::grpc::string system_imports = SystemImport("ProtoRPC/ProtoService.h") + ::grpc::string system_imports = SystemImport("ProtoRPC/ProtoService.h") +
SystemImport("ProtoRPC/ProtoRPC.h") + SystemImport("ProtoRPC/ProtoRPC.h") +
@ -106,7 +126,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
::grpc::string class_imports; ::grpc::string class_imports;
for (int i = 0; i < file->dependency_count(); i++) { for (int i = 0; i < file->dependency_count(); i++) {
class_imports += ImportProtoHeaders(file->dependency(i), " "); class_imports += ImportProtoHeaders(file->dependency(i), " ", framework);
} }
::grpc::string ng_protocols; ::grpc::string ng_protocols;
@ -141,14 +161,22 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
{ {
// Generate .pbrpc.m // Generate .pbrpc.m
::grpc::string imports = LocalImport(file_name + ".pbrpc.h") + ::grpc::string imports;
LocalImport(file_name + ".pbobjc.h") + if (framework.empty()) {
SystemImport("ProtoRPC/ProtoRPC.h") + imports = LocalImport(file_name + ".pbrpc.h") +
SystemImport("RxLibrary/GRXWriter+Immediate.h"); LocalImport(file_name + ".pbobjc.h") +
SystemImport("ProtoRPC/ProtoRPC.h") +
SystemImport("RxLibrary/GRXWriter+Immediate.h");
} else {
imports = FrameworkImport(file_name + ".pbrpc.h", framework) +
FrameworkImport(file_name + ".pbobjc.h", framework) +
SystemImport("ProtoRPC/ProtoRPC.h") +
SystemImport("RxLibrary/GRXWriter+Immediate.h");
}
::grpc::string class_imports; ::grpc::string class_imports;
for (int i = 0; i < file->dependency_count(); i++) { for (int i = 0; i < file->dependency_count(); i++) {
class_imports += ImportProtoHeaders(file->dependency(i), ""); class_imports += ImportProtoHeaders(file->dependency(i), "", framework);
} }
::grpc::string definitions; ::grpc::string definitions;

@ -7,7 +7,6 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
4182FA3FC32428BA5E84C311 /* libPods-InterceptorSample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 48F0BD18AEBB640DE5E58D79 /* libPods-InterceptorSample.a */; };
5EE960FB2266768A0044A74F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE960FA2266768A0044A74F /* AppDelegate.m */; }; 5EE960FB2266768A0044A74F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE960FA2266768A0044A74F /* AppDelegate.m */; };
5EE960FE2266768A0044A74F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE960FD2266768A0044A74F /* ViewController.m */; }; 5EE960FE2266768A0044A74F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE960FD2266768A0044A74F /* ViewController.m */; };
5EE961012266768A0044A74F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5EE960FF2266768A0044A74F /* Main.storyboard */; }; 5EE961012266768A0044A74F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5EE960FF2266768A0044A74F /* Main.storyboard */; };
@ -15,10 +14,11 @@
5EE961062266768C0044A74F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5EE961042266768C0044A74F /* LaunchScreen.storyboard */; }; 5EE961062266768C0044A74F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5EE961042266768C0044A74F /* LaunchScreen.storyboard */; };
5EE961092266768C0044A74F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE961082266768C0044A74F /* main.m */; }; 5EE961092266768C0044A74F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE961082266768C0044A74F /* main.m */; };
5EE9611222668CF20044A74F /* CacheInterceptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE9611122668CF20044A74F /* CacheInterceptor.m */; }; 5EE9611222668CF20044A74F /* CacheInterceptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE9611122668CF20044A74F /* CacheInterceptor.m */; };
9F142CE7AFDA64BD5AEE9849 /* libPods-InterceptorSample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8FBA9621C9B11B3AC233A96 /* libPods-InterceptorSample.a */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
48F0BD18AEBB640DE5E58D79 /* libPods-InterceptorSample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InterceptorSample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 18F2D91B047D36868BCD504B /* Pods-InterceptorSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InterceptorSample.release.xcconfig"; path = "Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample.release.xcconfig"; sourceTree = "<group>"; };
5EE960F62266768A0044A74F /* InterceptorSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = InterceptorSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 5EE960F62266768A0044A74F /* InterceptorSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = InterceptorSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
5EE960FA2266768A0044A74F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; 5EE960FA2266768A0044A74F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
5EE960FC2266768A0044A74F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; }; 5EE960FC2266768A0044A74F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
@ -31,8 +31,8 @@
5EE9610F2266774C0044A74F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; 5EE9610F2266774C0044A74F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
5EE9611022668CE20044A74F /* CacheInterceptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CacheInterceptor.h; sourceTree = "<group>"; }; 5EE9611022668CE20044A74F /* CacheInterceptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CacheInterceptor.h; sourceTree = "<group>"; };
5EE9611122668CF20044A74F /* CacheInterceptor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CacheInterceptor.m; sourceTree = "<group>"; }; 5EE9611122668CF20044A74F /* CacheInterceptor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CacheInterceptor.m; sourceTree = "<group>"; };
64B0278876AF54F8F95EDDCE /* Pods-InterceptorSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InterceptorSample.release.xcconfig"; path = "Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample.release.xcconfig"; sourceTree = "<group>"; }; AD256CCFA3FE501D3D876F1D /* Pods-InterceptorSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InterceptorSample.debug.xcconfig"; path = "Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample.debug.xcconfig"; sourceTree = "<group>"; };
6637EF5BBDFE0FFD47D9EAE7 /* Pods-InterceptorSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InterceptorSample.debug.xcconfig"; path = "Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample.debug.xcconfig"; sourceTree = "<group>"; }; B8FBA9621C9B11B3AC233A96 /* libPods-InterceptorSample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InterceptorSample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -40,7 +40,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
4182FA3FC32428BA5E84C311 /* libPods-InterceptorSample.a in Frameworks */, 9F142CE7AFDA64BD5AEE9849 /* libPods-InterceptorSample.a in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -53,7 +53,7 @@
5EE960F82266768A0044A74F /* InterceptorSample */, 5EE960F82266768A0044A74F /* InterceptorSample */,
5EE960F72266768A0044A74F /* Products */, 5EE960F72266768A0044A74F /* Products */,
9D49DB75F3BEDAFDE7028B51 /* Pods */, 9D49DB75F3BEDAFDE7028B51 /* Pods */,
A48ECC1BD9AFC8D93ECD2467 /* Frameworks */, B3868CDC20EB754A8D582F03 /* Frameworks */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@ -86,16 +86,16 @@
9D49DB75F3BEDAFDE7028B51 /* Pods */ = { 9D49DB75F3BEDAFDE7028B51 /* Pods */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
6637EF5BBDFE0FFD47D9EAE7 /* Pods-InterceptorSample.debug.xcconfig */, AD256CCFA3FE501D3D876F1D /* Pods-InterceptorSample.debug.xcconfig */,
64B0278876AF54F8F95EDDCE /* Pods-InterceptorSample.release.xcconfig */, 18F2D91B047D36868BCD504B /* Pods-InterceptorSample.release.xcconfig */,
); );
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
A48ECC1BD9AFC8D93ECD2467 /* Frameworks */ = { B3868CDC20EB754A8D582F03 /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
48F0BD18AEBB640DE5E58D79 /* libPods-InterceptorSample.a */, B8FBA9621C9B11B3AC233A96 /* libPods-InterceptorSample.a */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
@ -107,11 +107,11 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 5EE9610C2266768C0044A74F /* Build configuration list for PBXNativeTarget "InterceptorSample" */; buildConfigurationList = 5EE9610C2266768C0044A74F /* Build configuration list for PBXNativeTarget "InterceptorSample" */;
buildPhases = ( buildPhases = (
471EAA5F4DD4F2A125B3488B /* [CP] Check Pods Manifest.lock */, D31C16F578D4BF95F5638778 /* [CP] Check Pods Manifest.lock */,
5EE960F22266768A0044A74F /* Sources */, 5EE960F22266768A0044A74F /* Sources */,
5EE960F32266768A0044A74F /* Frameworks */, 5EE960F32266768A0044A74F /* Frameworks */,
5EE960F42266768A0044A74F /* Resources */, 5EE960F42266768A0044A74F /* Resources */,
77C5553636C977821737C752 /* [CP] Copy Pods Resources */, 45857CF606BB268EB3BC476F /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@ -168,43 +168,43 @@
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
471EAA5F4DD4F2A125B3488B /* [CP] Check Pods Manifest.lock */ = { 45857CF606BB268EB3BC476F /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample-resources-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = ( name = "[CP] Copy Pods Resources";
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = ( outputFileListPaths = (
); "${PODS_ROOT}/Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample-resources-${CONFIGURATION}-output-files.xcfilelist",
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-InterceptorSample-checkManifestLockResult.txt",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
77C5553636C977821737C752 /* [CP] Copy Pods Resources */ = { D31C16F578D4BF95F5638778 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample-resources-${CONFIGURATION}-input-files.xcfilelist",
); );
name = "[CP] Copy Pods Resources"; inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample-resources-${CONFIGURATION}-output-files.xcfilelist", );
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-InterceptorSample-checkManifestLockResult.txt",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample-resources.sh\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
@ -357,7 +357,7 @@
}; };
5EE9610D2266768C0044A74F /* Debug */ = { 5EE9610D2266768C0044A74F /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 6637EF5BBDFE0FFD47D9EAE7 /* Pods-InterceptorSample.debug.xcconfig */; baseConfigurationReference = AD256CCFA3FE501D3D876F1D /* Pods-InterceptorSample.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
@ -375,7 +375,7 @@
}; };
5EE9610E2266768C0044A74F /* Release */ = { 5EE9610E2266768C0044A74F /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 64B0278876AF54F8F95EDDCE /* Pods-InterceptorSample.release.xcconfig */; baseConfigurationReference = 18F2D91B047D36868BCD504B /* Pods-InterceptorSample.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;

@ -19,8 +19,13 @@
#import "ViewController.h" #import "ViewController.h"
#import <GRPCClient/GRPCCall.h> #import <GRPCClient/GRPCCall.h>
#if USE_FRAMEWORKS
#import <RemoteTest/Messages.pbobjc.h>
#import <RemoteTest/Test.pbrpc.h>
#else
#import "src/objective-c/examples/RemoteTestClient/Messages.pbobjc.h" #import "src/objective-c/examples/RemoteTestClient/Messages.pbobjc.h"
#import "src/objective-c/examples/RemoteTestClient/Test.pbrpc.h" #import "src/objective-c/examples/RemoteTestClient/Test.pbrpc.h"
#endif
#import "CacheInterceptor.h" #import "CacheInterceptor.h"

@ -2,6 +2,8 @@ platform :ios, '8.0'
install! 'cocoapods', :deterministic_uuids => false install! 'cocoapods', :deterministic_uuids => false
use_frameworks! if ENV['FRAMEWORKS'] != 'NO'
ROOT_DIR = '../../../..' ROOT_DIR = '../../../..'
target 'InterceptorSample' do target 'InterceptorSample' do

@ -20,26 +20,29 @@ Pod::Spec.new do |s|
well_known_types_dir = "#{repo_root}/third_party/protobuf/src" well_known_types_dir = "#{repo_root}/third_party/protobuf/src"
plugin = "#{bin_dir}/grpc_objective_c_plugin" plugin = "#{bin_dir}/grpc_objective_c_plugin"
s.prepare_command = <<-CMD if ENV['FRAMEWORKS'] != 'NO' then
if [ "$FRAMEWORKS" == "" ]; then s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'USE_FRAMEWORKS=1' }
s.prepare_command = <<-CMD
#{protoc} \ #{protoc} \
--plugin=protoc-gen-grpc=#{plugin} \ --plugin=protoc-gen-grpc=#{plugin} \
--objc_out=. \ --objc_out=. \
--grpc_out=. \ --grpc_out=generate_for_named_framework=#{s.name}:. \
--objc_opt=generate_for_named_framework=#{s.name} \
-I #{repo_root} \ -I #{repo_root} \
-I #{well_known_types_dir} \ -I #{well_known_types_dir} \
#{repo_root}/src/objective-c/examples/RemoteTestClient/*.proto #{repo_root}/src/objective-c/examples/RemoteTestClient/*.proto
else CMD
else
s.prepare_command = <<-CMD
#{protoc} \ #{protoc} \
--plugin=protoc-gen-grpc=#{plugin} \ --plugin=protoc-gen-grpc=#{plugin} \
--objc_out=. \ --objc_out=. \
--grpc_out=. \ --grpc_out=. \
--objc_opt=generate_for_named_framework=#{s.name} \
-I #{repo_root} \ -I #{repo_root} \
-I #{well_known_types_dir} \ -I #{well_known_types_dir} \
#{repo_root}/src/objective-c/examples/RemoteTestClient/*.proto #{repo_root}/src/objective-c/examples/RemoteTestClient/*.proto
fi CMD
CMD end
s.subspec 'Messages' do |ms| s.subspec 'Messages' do |ms|
ms.source_files = '**/*.pbobjc.{h,m}' ms.source_files = '**/*.pbobjc.{h,m}'
@ -55,7 +58,7 @@ Pod::Spec.new do |s|
ss.dependency 'gRPC-ProtoRPC' ss.dependency 'gRPC-ProtoRPC'
ss.dependency "#{s.name}/Messages" ss.dependency "#{s.name}/Messages"
end end
s.pod_target_xcconfig = { s.pod_target_xcconfig = {
# This is needed by all pods that depend on Protobuf: # This is needed by all pods that depend on Protobuf:
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1', 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',

@ -3,7 +3,7 @@ platform :ios, '8.0'
install! 'cocoapods', :deterministic_uuids => false install! 'cocoapods', :deterministic_uuids => false
use_frameworks! if ENV['FRAMEWORKS'] == 'YES' use_frameworks! if ENV['FRAMEWORKS'] != 'NO'
# Location of gRPC's repo root relative to this file. # Location of gRPC's repo root relative to this file.
GRPC_LOCAL_SRC = '../../../..' GRPC_LOCAL_SRC = '../../../..'

@ -12,11 +12,10 @@
6369A2761A9322E20015FC5C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6369A2751A9322E20015FC5C /* ViewController.m */; }; 6369A2761A9322E20015FC5C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6369A2751A9322E20015FC5C /* ViewController.m */; };
6369A2791A9322E20015FC5C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6369A2771A9322E20015FC5C /* Main.storyboard */; }; 6369A2791A9322E20015FC5C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6369A2771A9322E20015FC5C /* Main.storyboard */; };
6369A27B1A9322E20015FC5C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6369A27A1A9322E20015FC5C /* Images.xcassets */; }; 6369A27B1A9322E20015FC5C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6369A27A1A9322E20015FC5C /* Images.xcassets */; };
C8B8323DA07AC8C4499DC557 /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A874B5E91AC811A1EA0D12CF /* libPods-Sample.a */; }; 81BD5DEB744A906EF0708B68 /* Pods_Sample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6E85B2D77543A74F6CACF59A /* Pods_Sample.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
5A8C9F4B28733B249DE4AB6D /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = "<group>"; };
6369A26A1A9322E20015FC5C /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6369A26A1A9322E20015FC5C /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; };
6369A26E1A9322E20015FC5C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 6369A26E1A9322E20015FC5C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6369A26F1A9322E20015FC5C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; 6369A26F1A9322E20015FC5C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@ -26,8 +25,9 @@
6369A2751A9322E20015FC5C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; }; 6369A2751A9322E20015FC5C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
6369A2781A9322E20015FC5C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 6369A2781A9322E20015FC5C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
6369A27A1A9322E20015FC5C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; 6369A27A1A9322E20015FC5C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
A874B5E91AC811A1EA0D12CF /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 6E85B2D77543A74F6CACF59A /* Pods_Sample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Sample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E3C01DF315C4E7433BCEC6E6 /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = "<group>"; }; 7544F97DDF1CB3F915E41CB9 /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = "<group>"; };
8BDAC28EF9131C53B2E6870D /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -35,20 +35,28 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
C8B8323DA07AC8C4499DC557 /* libPods-Sample.a in Frameworks */, 81BD5DEB744A906EF0708B68 /* Pods_Sample.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
14C78F05D9C5E2D5F426D233 /* Frameworks */ = {
isa = PBXGroup;
children = (
6E85B2D77543A74F6CACF59A /* Pods_Sample.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
6369A2611A9322E20015FC5C = { 6369A2611A9322E20015FC5C = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
6369A26C1A9322E20015FC5C /* Sample */, 6369A26C1A9322E20015FC5C /* Sample */,
6369A26B1A9322E20015FC5C /* Products */, 6369A26B1A9322E20015FC5C /* Products */,
AB3331C9AE6488E61B2B094E /* Pods */, 9A3B057E55DE3C4F4A543CC5 /* Pods */,
C4C2C5219053E079C9EFB930 /* Frameworks */, 14C78F05D9C5E2D5F426D233 /* Frameworks */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@ -83,21 +91,13 @@
name = "Supporting Files"; name = "Supporting Files";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
AB3331C9AE6488E61B2B094E /* Pods */ = { 9A3B057E55DE3C4F4A543CC5 /* Pods */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E3C01DF315C4E7433BCEC6E6 /* Pods-Sample.debug.xcconfig */, 7544F97DDF1CB3F915E41CB9 /* Pods-Sample.debug.xcconfig */,
5A8C9F4B28733B249DE4AB6D /* Pods-Sample.release.xcconfig */, 8BDAC28EF9131C53B2E6870D /* Pods-Sample.release.xcconfig */,
); );
name = Pods; path = Pods;
sourceTree = "<group>";
};
C4C2C5219053E079C9EFB930 /* Frameworks */ = {
isa = PBXGroup;
children = (
A874B5E91AC811A1EA0D12CF /* libPods-Sample.a */,
);
name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
/* End PBXGroup section */ /* End PBXGroup section */
@ -107,11 +107,11 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 6369A28D1A9322E20015FC5C /* Build configuration list for PBXNativeTarget "Sample" */; buildConfigurationList = 6369A28D1A9322E20015FC5C /* Build configuration list for PBXNativeTarget "Sample" */;
buildPhases = ( buildPhases = (
41F7486D8F66994B0BFB84AF /* [CP] Check Pods Manifest.lock */, B8CFD95B6470E21429BC7DF0 /* [CP] Check Pods Manifest.lock */,
6369A2661A9322E20015FC5C /* Sources */, 6369A2661A9322E20015FC5C /* Sources */,
6369A2671A9322E20015FC5C /* Frameworks */, 6369A2671A9322E20015FC5C /* Frameworks */,
6369A2681A9322E20015FC5C /* Resources */, 6369A2681A9322E20015FC5C /* Resources */,
04554623324BE4A838846086 /* [CP] Copy Pods Resources */, BFA56A3C239159EE5FFE4D61 /* [CP] Embed Pods Frameworks */,
); );
buildRules = ( buildRules = (
); );
@ -167,40 +167,58 @@
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
04554623324BE4A838846086 /* [CP] Copy Pods Resources */ = { B8CFD95B6470E21429BC7DF0 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = (
);
inputPaths = ( inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-resources.sh", "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle", "${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
); );
name = "[CP] Copy Pods Resources";
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle", "$(DERIVED_FILE_DIR)/Pods-Sample-checkManifestLockResult.txt",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
41F7486D8F66994B0BFB84AF /* [CP] Check Pods Manifest.lock */ = { BFA56A3C239159EE5FFE4D61 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh",
"${PODS_ROOT}/Manifest.lock", "${BUILT_PRODUCTS_DIR}/BoringSSL-GRPC/openssl_grpc.framework",
"${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework",
"${BUILT_PRODUCTS_DIR}/RemoteTest/RemoteTest.framework",
"${BUILT_PRODUCTS_DIR}/gRPC/GRPCClient.framework",
"${BUILT_PRODUCTS_DIR}/gRPC-Core/grpc.framework",
"${BUILT_PRODUCTS_DIR}/gRPC-ProtoRPC/ProtoRPC.framework",
"${BUILT_PRODUCTS_DIR}/gRPC-RxLibrary/RxLibrary.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
); );
name = "[CP] Check Pods Manifest.lock"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Sample-checkManifestLockResult.txt", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl_grpc.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RemoteTest.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GRPCClient.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpc.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ProtoRPC.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxLibrary.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
@ -311,9 +329,10 @@
}; };
6369A28E1A9322E20015FC5C /* Debug */ = { 6369A28E1A9322E20015FC5C /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = E3C01DF315C4E7433BCEC6E6 /* Pods-Sample.debug.xcconfig */; baseConfigurationReference = 7544F97DDF1CB3F915E41CB9 /* Pods-Sample.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
INFOPLIST_FILE = Sample/Info.plist; INFOPLIST_FILE = Sample/Info.plist;
LD_GENERATE_MAP_FILE = YES; LD_GENERATE_MAP_FILE = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@ -324,9 +343,10 @@
}; };
6369A28F1A9322E20015FC5C /* Release */ = { 6369A28F1A9322E20015FC5C /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 5A8C9F4B28733B249DE4AB6D /* Pods-Sample.release.xcconfig */; baseConfigurationReference = 8BDAC28EF9131C53B2E6870D /* Pods-Sample.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
INFOPLIST_FILE = Sample/Info.plist; INFOPLIST_FILE = Sample/Info.plist;
LD_GENERATE_MAP_FILE = YES; LD_GENERATE_MAP_FILE = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

@ -20,8 +20,13 @@
#import <GRPCClient/GRPCCall.h> #import <GRPCClient/GRPCCall.h>
#import <ProtoRPC/ProtoMethod.h> #import <ProtoRPC/ProtoMethod.h>
#if USE_FRAMEWORKS
#import <RemoteTest/Messages.pbobjc.h>
#import <RemoteTest/Test.pbrpc.h>
#else
#import "src/objective-c/examples/RemoteTestClient/Messages.pbobjc.h" #import "src/objective-c/examples/RemoteTestClient/Messages.pbobjc.h"
#import "src/objective-c/examples/RemoteTestClient/Test.pbrpc.h" #import "src/objective-c/examples/RemoteTestClient/Test.pbrpc.h"
#endif
#import <RxLibrary/GRXWriteable.h> #import <RxLibrary/GRXWriteable.h>
#import <RxLibrary/GRXWriter+Immediate.h> #import <RxLibrary/GRXWriter+Immediate.h>

@ -1,5 +1,15 @@
{ {
"images" : [ "images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{ {
"idiom" : "iphone", "idiom" : "iphone",
"size" : "29x29", "size" : "29x29",
@ -30,6 +40,16 @@
"size" : "60x60", "size" : "60x60",
"scale" : "3x" "scale" : "3x"
}, },
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{ {
"idiom" : "ipad", "idiom" : "ipad",
"size" : "29x29", "size" : "29x29",
@ -59,6 +79,16 @@
"idiom" : "ipad", "idiom" : "ipad",
"size" : "76x76", "size" : "76x76",
"scale" : "2x" "scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
} }
], ],
"info" : { "info" : {

@ -1,55 +0,0 @@
Pod::Spec.new do |s|
s.name = 'RemoteTest'
s.version = '0.0.1'
s.license = 'Apache License, Version 2.0'
s.authors = { 'gRPC contributors' => 'grpc-io@googlegroups.com' }
s.homepage = 'https://grpc.io/'
s.summary = 'RemoteTest example'
s.source = { :git => 'https://github.com/grpc/grpc.git' }
s.ios.deployment_target = '7.1'
s.osx.deployment_target = '10.9'
# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
s.dependency "!ProtoCompiler-gRPCPlugin"
repo_root = '../../../..'
bin_dir = "#{repo_root}/bins/$CONFIG"
protoc = "#{bin_dir}/protobuf/protoc"
well_known_types_dir = "#{repo_root}/third_party/protobuf/src"
plugin = "#{bin_dir}/grpc_objective_c_plugin"
s.prepare_command = <<-CMD
#{protoc} \
--plugin=protoc-gen-grpc=#{plugin} \
--objc_out=. \
--grpc_out=. \
-I . \
-I #{well_known_types_dir} \
*.proto
CMD
s.subspec 'Messages' do |ms|
ms.source_files = '**/*.pbobjc.{h,m}'
ms.header_mappings_dir = '.'
ms.requires_arc = false
ms.dependency 'Protobuf'
end
s.subspec 'Services' do |ss|
ss.source_files = '**/*.pbrpc.{h,m}'
ss.header_mappings_dir = '.'
ss.requires_arc = true
ss.dependency 'gRPC-ProtoRPC'
ss.dependency "#{s.name}/Messages"
end
s.pod_target_xcconfig = {
# This is needed by all pods that depend on Protobuf:
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
# This is needed by all pods that depend on gRPC-RxLibrary:
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
}
end

@ -7,23 +7,23 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
2A4D33FC1BAD9EE77F27E82F /* Pods_SwiftSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D24BFC7BA3339DF6B9A04EF /* Pods_SwiftSample.framework */; };
633BFFC81B950B210007E424 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 633BFFC71B950B210007E424 /* AppDelegate.swift */; }; 633BFFC81B950B210007E424 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 633BFFC71B950B210007E424 /* AppDelegate.swift */; };
633BFFCA1B950B210007E424 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 633BFFC91B950B210007E424 /* ViewController.swift */; }; 633BFFCA1B950B210007E424 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 633BFFC91B950B210007E424 /* ViewController.swift */; };
633BFFCD1B950B210007E424 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 633BFFCB1B950B210007E424 /* Main.storyboard */; }; 633BFFCD1B950B210007E424 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 633BFFCB1B950B210007E424 /* Main.storyboard */; };
633BFFCF1B950B210007E424 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 633BFFCE1B950B210007E424 /* Images.xcassets */; }; 633BFFCF1B950B210007E424 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 633BFFCE1B950B210007E424 /* Images.xcassets */; };
AC669361C16100FA4D34D7D1 /* Pods_SwiftSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CB8E8B90EEE20DEB124EE37 /* Pods_SwiftSample.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
544DD51C2905B1B0B00F57F3 /* Pods-SwiftSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftSample.debug.xcconfig"; path = "Target Support Files/Pods-SwiftSample/Pods-SwiftSample.debug.xcconfig"; sourceTree = "<group>"; };
5CB8E8B90EEE20DEB124EE37 /* Pods_SwiftSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftSample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
633BFFC21B950B210007E424 /* SwiftSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 633BFFC21B950B210007E424 /* SwiftSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
633BFFC61B950B210007E424 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 633BFFC61B950B210007E424 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
633BFFC71B950B210007E424 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 633BFFC71B950B210007E424 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
633BFFC91B950B210007E424 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; 633BFFC91B950B210007E424 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
633BFFCC1B950B210007E424 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 633BFFCC1B950B210007E424 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
633BFFCE1B950B210007E424 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; 633BFFCE1B950B210007E424 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
7AD632A1760ED763C0BFFD0A /* Pods-SwiftSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftSample.release.xcconfig"; path = "Target Support Files/Pods-SwiftSample/Pods-SwiftSample.release.xcconfig"; sourceTree = "<group>"; }; FAF69508F6AEB00B2D2EB3F2 /* Pods-SwiftSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftSample.release.xcconfig"; path = "Target Support Files/Pods-SwiftSample/Pods-SwiftSample.release.xcconfig"; sourceTree = "<group>"; };
7D24BFC7BA3339DF6B9A04EF /* Pods_SwiftSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftSample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D6F1AAEB4FD0559A16605616 /* Pods-SwiftSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftSample.debug.xcconfig"; path = "Target Support Files/Pods-SwiftSample/Pods-SwiftSample.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -31,30 +31,20 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
2A4D33FC1BAD9EE77F27E82F /* Pods_SwiftSample.framework in Frameworks */, AC669361C16100FA4D34D7D1 /* Pods_SwiftSample.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
3C394733A73BFFE2995E6DC5 /* Pods */ = {
isa = PBXGroup;
children = (
D6F1AAEB4FD0559A16605616 /* Pods-SwiftSample.debug.xcconfig */,
7AD632A1760ED763C0BFFD0A /* Pods-SwiftSample.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
633BFFB91B950B210007E424 = { 633BFFB91B950B210007E424 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
633BFFC41B950B210007E424 /* SwiftSample */, 633BFFC41B950B210007E424 /* SwiftSample */,
633BFFC31B950B210007E424 /* Products */, 633BFFC31B950B210007E424 /* Products */,
3C394733A73BFFE2995E6DC5 /* Pods */, B26D8B90A783952E7BE194D9 /* Pods */,
B3B46435EDEAE7572BF484F5 /* Frameworks */, 66C10D7692132083F1F396C6 /* Frameworks */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@ -86,14 +76,24 @@
name = "Supporting Files"; name = "Supporting Files";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
B3B46435EDEAE7572BF484F5 /* Frameworks */ = { 66C10D7692132083F1F396C6 /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
7D24BFC7BA3339DF6B9A04EF /* Pods_SwiftSample.framework */, 5CB8E8B90EEE20DEB124EE37 /* Pods_SwiftSample.framework */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
B26D8B90A783952E7BE194D9 /* Pods */ = {
isa = PBXGroup;
children = (
544DD51C2905B1B0B00F57F3 /* Pods-SwiftSample.debug.xcconfig */,
FAF69508F6AEB00B2D2EB3F2 /* Pods-SwiftSample.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
@ -101,11 +101,11 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 633BFFE11B950B210007E424 /* Build configuration list for PBXNativeTarget "SwiftSample" */; buildConfigurationList = 633BFFE11B950B210007E424 /* Build configuration list for PBXNativeTarget "SwiftSample" */;
buildPhases = ( buildPhases = (
0BCFE5CC859FA15414AF3B5A /* [CP] Check Pods Manifest.lock */, 405474DAAC9EB5A0055F82FA /* [CP] Check Pods Manifest.lock */,
633BFFBE1B950B210007E424 /* Sources */, 633BFFBE1B950B210007E424 /* Sources */,
633BFFBF1B950B210007E424 /* Frameworks */, 633BFFBF1B950B210007E424 /* Frameworks */,
633BFFC01B950B210007E424 /* Resources */, 633BFFC01B950B210007E424 /* Resources */,
6998570BEA68700C0183464C /* [CP] Embed Pods Frameworks */, 983E7AC7007F28ADB66E485B /* [CP] Embed Pods Frameworks */,
); );
buildRules = ( buildRules = (
); );
@ -162,7 +162,7 @@
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
0BCFE5CC859FA15414AF3B5A /* [CP] Check Pods Manifest.lock */ = { 405474DAAC9EB5A0055F82FA /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
@ -184,7 +184,7 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
6998570BEA68700C0183464C /* [CP] Embed Pods Frameworks */ = { 983E7AC7007F28ADB66E485B /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
@ -330,7 +330,7 @@
}; };
633BFFE21B950B210007E424 /* Debug */ = { 633BFFE21B950B210007E424 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = D6F1AAEB4FD0559A16605616 /* Pods-SwiftSample.debug.xcconfig */; baseConfigurationReference = 544DD51C2905B1B0B00F57F3 /* Pods-SwiftSample.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Info.plist; INFOPLIST_FILE = Info.plist;
@ -345,7 +345,7 @@
}; };
633BFFE31B950B210007E424 /* Release */ = { 633BFFE31B950B210007E424 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AD632A1760ED763C0BFFD0A /* Pods-SwiftSample.release.xcconfig */; baseConfigurationReference = FAF69508F6AEB00B2D2EB3F2 /* Pods-SwiftSample.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Info.plist; INFOPLIST_FILE = Info.plist;

@ -1,118 +0,0 @@
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Message definitions to be used by integration test service definitions.
syntax = "proto3";
package grpc.testing;
option objc_class_prefix = "RMT";
// The type of payload that should be returned.
enum PayloadType {
// Compressable text format.
COMPRESSABLE = 0;
// Uncompressable binary format.
UNCOMPRESSABLE = 1;
// Randomly chosen from all other formats defined in this enum.
RANDOM = 2;
}
// A block of data, to simply increase gRPC message size.
message Payload {
// The type of data in body.
PayloadType type = 1;
// Primary contents of payload.
bytes body = 2;
}
// Unary request.
message SimpleRequest {
// Desired payload type in the response from the server.
// If response_type is RANDOM, server randomly chooses one from other formats.
PayloadType response_type = 1;
// Desired payload size in the response from the server.
// If response_type is COMPRESSABLE, this denotes the size before compression.
int32 response_size = 2;
// Optional input payload sent along with the request.
Payload payload = 3;
// Whether SimpleResponse should include username.
bool fill_username = 4;
// Whether SimpleResponse should include OAuth scope.
bool fill_oauth_scope = 5;
}
// Unary response, as configured by the request.
message SimpleResponse {
// Payload to increase message size.
Payload payload = 1;
// The user the request came from, for verifying authentication was
// successful when the client expected it.
string username = 2;
// OAuth scope.
string oauth_scope = 3;
}
// Client-streaming request.
message StreamingInputCallRequest {
// Optional input payload sent along with the request.
Payload payload = 1;
// Not expecting any payload from the response.
}
// Client-streaming response.
message StreamingInputCallResponse {
// Aggregated size of payloads received from the client.
int32 aggregated_payload_size = 1;
}
// Configuration for a particular response.
message ResponseParameters {
// Desired payload sizes in responses from the server.
// If response_type is COMPRESSABLE, this denotes the size before compression.
int32 size = 1;
// Desired interval between consecutive responses in the response stream in
// microseconds.
int32 interval_us = 2;
}
// Server-streaming request.
message StreamingOutputCallRequest {
// Desired payload type in the response from the server.
// If response_type is RANDOM, the payload from each response in the stream
// might be of different types. This is to simulate a mixed type of payload
// stream.
PayloadType response_type = 1;
// Configuration for each expected response message.
repeated ResponseParameters response_parameters = 2;
// Optional input payload sent along with the request.
Payload payload = 3;
}
// Server-streaming response, as configured by the request and parameters.
message StreamingOutputCallResponse {
// Payload to increase response size.
Payload payload = 1;
}

@ -1,57 +0,0 @@
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// An integration test service that covers all the method signature permutations
// of unary/streaming requests/responses.
syntax = "proto3";
import "google/protobuf/empty.proto";
import "messages.proto";
package grpc.testing;
option objc_class_prefix = "RMT";
// A simple service to test the various types of RPCs and experiment with
// performance with various types of payload.
service TestService {
// One empty request followed by one empty response.
rpc EmptyCall(google.protobuf.Empty) returns (google.protobuf.Empty);
// One request followed by one response.
rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
// One request followed by a sequence of responses (streamed download).
// The server returns the payload with client desired type and sizes.
rpc StreamingOutputCall(StreamingOutputCallRequest)
returns (stream StreamingOutputCallResponse);
// A sequence of requests followed by one response (streamed upload).
// The server returns the aggregated size of client payload as the result.
rpc StreamingInputCall(stream StreamingInputCallRequest)
returns (StreamingInputCallResponse);
// A sequence of requests with each request served by the server immediately.
// As one request could lead to multiple responses, this interface
// demonstrates the idea of full duplexing.
rpc FullDuplexCall(stream StreamingOutputCallRequest)
returns (stream StreamingOutputCallResponse);
// A sequence of requests followed by a sequence of responses.
// The server buffers all the client requests and then serves them in order. A
// stream of responses are returned to the client when the server starts with
// first request.
rpc HalfDuplexCall(stream StreamingOutputCallRequest)
returns (stream StreamingOutputCallResponse);
}
Loading…
Cancel
Save