From 431c5306baad10b5623f734d060d9eb40eebd74d Mon Sep 17 00:00:00 2001 From: Tony Lu Date: Thu, 25 Jul 2019 14:48:14 -0700 Subject: [PATCH] Used framework imports within generated stubs where necessary --- src/compiler/objective_c_generator_helpers.h | 12 ++ src/compiler/objective_c_plugin.cc | 48 +++++-- .../project.pbxproj | 58 ++++----- .../InterceptorSample/ViewController.m | 5 + .../examples/InterceptorSample/Podfile | 2 + .../RemoteTestClient/RemoteTest.podspec | 19 +-- src/objective-c/examples/Sample/Podfile | 2 +- .../Sample/Sample.xcodeproj/project.pbxproj | 90 +++++++------ .../examples/Sample/Sample/ViewController.m | 5 + .../AppIcon.appiconset/Contents.json | 30 +++++ .../examples/SwiftSample/RemoteTest.podspec | 55 -------- .../SwiftSample.xcodeproj/project.pbxproj | 50 ++++---- .../examples/SwiftSample/messages.proto | 118 ------------------ .../examples/SwiftSample/test.proto | 57 --------- 14 files changed, 213 insertions(+), 338 deletions(-) delete mode 100644 src/objective-c/examples/SwiftSample/RemoteTest.podspec delete mode 100644 src/objective-c/examples/SwiftSample/messages.proto delete mode 100644 src/objective-c/examples/SwiftSample/test.proto diff --git a/src/compiler/objective_c_generator_helpers.h b/src/compiler/objective_c_generator_helpers.h index a284da97f4b..de8f52d802c 100644 --- a/src/compiler/objective_c_generator_helpers.h +++ b/src/compiler/objective_c_generator_helpers.h @@ -19,6 +19,10 @@ #ifndef GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H #define GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H +#include +using namespace std; + + #include #include "src/compiler/config.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"); } +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) { return ::grpc::string("#import <" + import + ">\n"); } diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 87977095d05..3ac7ea13a96 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -30,6 +30,7 @@ using ::google::protobuf::compiler::objectivec:: IsProtobufLibraryBundledProtoFile; using ::google::protobuf::compiler::objectivec::ProtobufLibraryFrameworkName; using ::grpc_objective_c_generator::LocalImport; +using ::grpc_objective_c_generator::FrameworkImport; using ::grpc_objective_c_generator::PreprocIfElse; using ::grpc_objective_c_generator::PreprocIfNot; using ::grpc_objective_c_generator::SystemImport; @@ -37,11 +38,16 @@ using ::grpc_objective_c_generator::SystemImport; namespace { 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); + // cerr << header << endl; 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; @@ -74,6 +80,15 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { 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 kNonNullEnd = "NS_ASSUME_NONNULL_END\n"; static const ::grpc::string kProtocolOnly = "GPB_GRPC_PROTOCOL_ONLY"; @@ -85,8 +100,13 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { { // 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") + SystemImport("ProtoRPC/ProtoRPC.h") + @@ -106,7 +126,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { ::grpc::string class_imports; 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; @@ -141,14 +161,22 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { { // Generate .pbrpc.m - ::grpc::string imports = LocalImport(file_name + ".pbrpc.h") + - LocalImport(file_name + ".pbobjc.h") + - SystemImport("ProtoRPC/ProtoRPC.h") + - SystemImport("RxLibrary/GRXWriter+Immediate.h"); + ::grpc::string imports; + if (framework.empty()) { + imports = LocalImport(file_name + ".pbrpc.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; 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; diff --git a/src/objective-c/examples/InterceptorSample/InterceptorSample.xcodeproj/project.pbxproj b/src/objective-c/examples/InterceptorSample/InterceptorSample.xcodeproj/project.pbxproj index 840f9760879..b3f9d0500e5 100644 --- a/src/objective-c/examples/InterceptorSample/InterceptorSample.xcodeproj/project.pbxproj +++ b/src/objective-c/examples/InterceptorSample/InterceptorSample.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* 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 */; }; 5EE960FE2266768A0044A74F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE960FD2266768A0044A74F /* ViewController.m */; }; 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 */; }; 5EE961092266768C0044A74F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE961082266768C0044A74F /* main.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 */ /* 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 = ""; }; 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 = ""; }; 5EE960FC2266768A0044A74F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; @@ -31,8 +31,8 @@ 5EE9610F2266774C0044A74F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 5EE9611022668CE20044A74F /* CacheInterceptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CacheInterceptor.h; sourceTree = ""; }; 5EE9611122668CF20044A74F /* CacheInterceptor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CacheInterceptor.m; sourceTree = ""; }; - 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 = ""; }; - 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 = ""; }; + 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 = ""; }; + B8FBA9621C9B11B3AC233A96 /* libPods-InterceptorSample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InterceptorSample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -40,7 +40,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4182FA3FC32428BA5E84C311 /* libPods-InterceptorSample.a in Frameworks */, + 9F142CE7AFDA64BD5AEE9849 /* libPods-InterceptorSample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -53,7 +53,7 @@ 5EE960F82266768A0044A74F /* InterceptorSample */, 5EE960F72266768A0044A74F /* Products */, 9D49DB75F3BEDAFDE7028B51 /* Pods */, - A48ECC1BD9AFC8D93ECD2467 /* Frameworks */, + B3868CDC20EB754A8D582F03 /* Frameworks */, ); sourceTree = ""; }; @@ -86,16 +86,16 @@ 9D49DB75F3BEDAFDE7028B51 /* Pods */ = { isa = PBXGroup; children = ( - 6637EF5BBDFE0FFD47D9EAE7 /* Pods-InterceptorSample.debug.xcconfig */, - 64B0278876AF54F8F95EDDCE /* Pods-InterceptorSample.release.xcconfig */, + AD256CCFA3FE501D3D876F1D /* Pods-InterceptorSample.debug.xcconfig */, + 18F2D91B047D36868BCD504B /* Pods-InterceptorSample.release.xcconfig */, ); path = Pods; sourceTree = ""; }; - A48ECC1BD9AFC8D93ECD2467 /* Frameworks */ = { + B3868CDC20EB754A8D582F03 /* Frameworks */ = { isa = PBXGroup; children = ( - 48F0BD18AEBB640DE5E58D79 /* libPods-InterceptorSample.a */, + B8FBA9621C9B11B3AC233A96 /* libPods-InterceptorSample.a */, ); name = Frameworks; sourceTree = ""; @@ -107,11 +107,11 @@ isa = PBXNativeTarget; buildConfigurationList = 5EE9610C2266768C0044A74F /* Build configuration list for PBXNativeTarget "InterceptorSample" */; buildPhases = ( - 471EAA5F4DD4F2A125B3488B /* [CP] Check Pods Manifest.lock */, + D31C16F578D4BF95F5638778 /* [CP] Check Pods Manifest.lock */, 5EE960F22266768A0044A74F /* Sources */, 5EE960F32266768A0044A74F /* Frameworks */, 5EE960F42266768A0044A74F /* Resources */, - 77C5553636C977821737C752 /* [CP] Copy Pods Resources */, + 45857CF606BB268EB3BC476F /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -168,43 +168,43 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 471EAA5F4DD4F2A125B3488B /* [CP] Check Pods Manifest.lock */ = { + 45857CF606BB268EB3BC476F /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-InterceptorSample-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; 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; }; - 77C5553636C977821737C752 /* [CP] Copy Pods Resources */ = { + D31C16F578D4BF95F5638778 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); 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 = ( - "${PODS_ROOT}/Target Support Files/Pods-InterceptorSample/Pods-InterceptorSample-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-InterceptorSample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; 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; }; /* End PBXShellScriptBuildPhase section */ @@ -357,7 +357,7 @@ }; 5EE9610D2266768C0044A74F /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6637EF5BBDFE0FFD47D9EAE7 /* Pods-InterceptorSample.debug.xcconfig */; + baseConfigurationReference = AD256CCFA3FE501D3D876F1D /* Pods-InterceptorSample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; @@ -375,7 +375,7 @@ }; 5EE9610E2266768C0044A74F /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 64B0278876AF54F8F95EDDCE /* Pods-InterceptorSample.release.xcconfig */; + baseConfigurationReference = 18F2D91B047D36868BCD504B /* Pods-InterceptorSample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; diff --git a/src/objective-c/examples/InterceptorSample/InterceptorSample/ViewController.m b/src/objective-c/examples/InterceptorSample/InterceptorSample/ViewController.m index b0e66636028..ac6ce6752d9 100644 --- a/src/objective-c/examples/InterceptorSample/InterceptorSample/ViewController.m +++ b/src/objective-c/examples/InterceptorSample/InterceptorSample/ViewController.m @@ -19,8 +19,13 @@ #import "ViewController.h" #import +#if USE_FRAMEWORKS +#import +#import +#else #import "src/objective-c/examples/RemoteTestClient/Messages.pbobjc.h" #import "src/objective-c/examples/RemoteTestClient/Test.pbrpc.h" +#endif #import "CacheInterceptor.h" diff --git a/src/objective-c/examples/InterceptorSample/Podfile b/src/objective-c/examples/InterceptorSample/Podfile index b20813d32aa..6df6c962148 100644 --- a/src/objective-c/examples/InterceptorSample/Podfile +++ b/src/objective-c/examples/InterceptorSample/Podfile @@ -2,6 +2,8 @@ platform :ios, '8.0' install! 'cocoapods', :deterministic_uuids => false +use_frameworks! if ENV['FRAMEWORKS'] != 'NO' + ROOT_DIR = '../../../..' target 'InterceptorSample' do diff --git a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec index 5bf1252aed8..fbc37317ba1 100644 --- a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec +++ b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec @@ -20,26 +20,29 @@ Pod::Spec.new do |s| well_known_types_dir = "#{repo_root}/third_party/protobuf/src" plugin = "#{bin_dir}/grpc_objective_c_plugin" - s.prepare_command = <<-CMD - if [ "$FRAMEWORKS" == "" ]; then + if ENV['FRAMEWORKS'] != 'NO' then + s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'USE_FRAMEWORKS=1' } + s.prepare_command = <<-CMD #{protoc} \ --plugin=protoc-gen-grpc=#{plugin} \ --objc_out=. \ - --grpc_out=. \ + --grpc_out=generate_for_named_framework=#{s.name}:. \ + --objc_opt=generate_for_named_framework=#{s.name} \ -I #{repo_root} \ -I #{well_known_types_dir} \ #{repo_root}/src/objective-c/examples/RemoteTestClient/*.proto - else + CMD + else + s.prepare_command = <<-CMD #{protoc} \ --plugin=protoc-gen-grpc=#{plugin} \ --objc_out=. \ --grpc_out=. \ - --objc_opt=generate_for_named_framework=#{s.name} \ -I #{repo_root} \ -I #{well_known_types_dir} \ #{repo_root}/src/objective-c/examples/RemoteTestClient/*.proto - fi - CMD + CMD + end s.subspec 'Messages' do |ms| ms.source_files = '**/*.pbobjc.{h,m}' @@ -55,7 +58,7 @@ Pod::Spec.new do |s| 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', diff --git a/src/objective-c/examples/Sample/Podfile b/src/objective-c/examples/Sample/Podfile index bebd55bd628..741a199602e 100644 --- a/src/objective-c/examples/Sample/Podfile +++ b/src/objective-c/examples/Sample/Podfile @@ -3,7 +3,7 @@ platform :ios, '8.0' 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. GRPC_LOCAL_SRC = '../../../..' diff --git a/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj b/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj index 33bdc378165..43bcac028a1 100644 --- a/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj +++ b/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj @@ -12,11 +12,10 @@ 6369A2761A9322E20015FC5C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6369A2751A9322E20015FC5C /* ViewController.m */; }; 6369A2791A9322E20015FC5C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6369A2771A9322E20015FC5C /* Main.storyboard */; }; 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 */ /* 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 = ""; }; 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 = ""; }; 6369A26F1A9322E20015FC5C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; @@ -26,8 +25,9 @@ 6369A2751A9322E20015FC5C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 6369A2781A9322E20015FC5C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 6369A27A1A9322E20015FC5C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - A874B5E91AC811A1EA0D12CF /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; 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 = ""; }; + 6E85B2D77543A74F6CACF59A /* Pods_Sample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Sample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 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 = ""; }; + 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -35,20 +35,28 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C8B8323DA07AC8C4499DC557 /* libPods-Sample.a in Frameworks */, + 81BD5DEB744A906EF0708B68 /* Pods_Sample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 14C78F05D9C5E2D5F426D233 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6E85B2D77543A74F6CACF59A /* Pods_Sample.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 6369A2611A9322E20015FC5C = { isa = PBXGroup; children = ( 6369A26C1A9322E20015FC5C /* Sample */, 6369A26B1A9322E20015FC5C /* Products */, - AB3331C9AE6488E61B2B094E /* Pods */, - C4C2C5219053E079C9EFB930 /* Frameworks */, + 9A3B057E55DE3C4F4A543CC5 /* Pods */, + 14C78F05D9C5E2D5F426D233 /* Frameworks */, ); sourceTree = ""; }; @@ -83,21 +91,13 @@ name = "Supporting Files"; sourceTree = ""; }; - AB3331C9AE6488E61B2B094E /* Pods */ = { + 9A3B057E55DE3C4F4A543CC5 /* Pods */ = { isa = PBXGroup; children = ( - E3C01DF315C4E7433BCEC6E6 /* Pods-Sample.debug.xcconfig */, - 5A8C9F4B28733B249DE4AB6D /* Pods-Sample.release.xcconfig */, + 7544F97DDF1CB3F915E41CB9 /* Pods-Sample.debug.xcconfig */, + 8BDAC28EF9131C53B2E6870D /* Pods-Sample.release.xcconfig */, ); - name = Pods; - sourceTree = ""; - }; - C4C2C5219053E079C9EFB930 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A874B5E91AC811A1EA0D12CF /* libPods-Sample.a */, - ); - name = Frameworks; + path = Pods; sourceTree = ""; }; /* End PBXGroup section */ @@ -107,11 +107,11 @@ isa = PBXNativeTarget; buildConfigurationList = 6369A28D1A9322E20015FC5C /* Build configuration list for PBXNativeTarget "Sample" */; buildPhases = ( - 41F7486D8F66994B0BFB84AF /* [CP] Check Pods Manifest.lock */, + B8CFD95B6470E21429BC7DF0 /* [CP] Check Pods Manifest.lock */, 6369A2661A9322E20015FC5C /* Sources */, 6369A2671A9322E20015FC5C /* Frameworks */, 6369A2681A9322E20015FC5C /* Resources */, - 04554623324BE4A838846086 /* [CP] Copy Pods Resources */, + BFA56A3C239159EE5FFE4D61 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -167,40 +167,58 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 04554623324BE4A838846086 /* [CP] Copy Pods Resources */ = { + B8CFD95B6470E21429BC7DF0 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-resources.sh", - "${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle", + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "[CP] Copy Pods Resources"; outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle", + "$(DERIVED_FILE_DIR)/Pods-Sample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; 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; }; - 41F7486D8F66994B0BFB84AF /* [CP] Check Pods Manifest.lock */ = { + BFA56A3C239159EE5FFE4D61 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", + "${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh", + "${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 = ( - "$(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; 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; }; /* End PBXShellScriptBuildPhase section */ @@ -311,9 +329,10 @@ }; 6369A28E1A9322E20015FC5C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E3C01DF315C4E7433BCEC6E6 /* Pods-Sample.debug.xcconfig */; + baseConfigurationReference = 7544F97DDF1CB3F915E41CB9 /* Pods-Sample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; INFOPLIST_FILE = Sample/Info.plist; LD_GENERATE_MAP_FILE = YES; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -324,9 +343,10 @@ }; 6369A28F1A9322E20015FC5C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5A8C9F4B28733B249DE4AB6D /* Pods-Sample.release.xcconfig */; + baseConfigurationReference = 8BDAC28EF9131C53B2E6870D /* Pods-Sample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; INFOPLIST_FILE = Sample/Info.plist; LD_GENERATE_MAP_FILE = YES; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; diff --git a/src/objective-c/examples/Sample/Sample/ViewController.m b/src/objective-c/examples/Sample/Sample/ViewController.m index 2171a923d79..e4f3712d72d 100644 --- a/src/objective-c/examples/Sample/Sample/ViewController.m +++ b/src/objective-c/examples/Sample/Sample/ViewController.m @@ -20,8 +20,13 @@ #import #import +#if USE_FRAMEWORKS +#import +#import +#else #import "src/objective-c/examples/RemoteTestClient/Messages.pbobjc.h" #import "src/objective-c/examples/RemoteTestClient/Test.pbrpc.h" +#endif #import #import diff --git a/src/objective-c/examples/SwiftSample/Images.xcassets/AppIcon.appiconset/Contents.json b/src/objective-c/examples/SwiftSample/Images.xcassets/AppIcon.appiconset/Contents.json index 36d2c80d889..d8db8d65fd7 100644 --- a/src/objective-c/examples/SwiftSample/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/src/objective-c/examples/SwiftSample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", @@ -30,6 +40,16 @@ "size" : "60x60", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "idiom" : "ipad", "size" : "29x29", @@ -59,6 +79,16 @@ "idiom" : "ipad", "size" : "76x76", "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/src/objective-c/examples/SwiftSample/RemoteTest.podspec b/src/objective-c/examples/SwiftSample/RemoteTest.podspec deleted file mode 100644 index e5f910c82d0..00000000000 --- a/src/objective-c/examples/SwiftSample/RemoteTest.podspec +++ /dev/null @@ -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 diff --git a/src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj b/src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj index ec8883456e4..953152e6153 100644 --- a/src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj +++ b/src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj @@ -7,23 +7,23 @@ objects = { /* 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 */; }; 633BFFCA1B950B210007E424 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 633BFFC91B950B210007E424 /* ViewController.swift */; }; 633BFFCD1B950B210007E424 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 633BFFCB1B950B210007E424 /* Main.storyboard */; }; 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 */ /* 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 = ""; }; + 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; }; 633BFFC61B950B210007E424 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 633BFFC71B950B210007E424 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 633BFFC91B950B210007E424 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 633BFFCC1B950B210007E424 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 633BFFCE1B950B210007E424 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 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 = ""; }; - 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 = ""; }; + 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -31,30 +31,20 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2A4D33FC1BAD9EE77F27E82F /* Pods_SwiftSample.framework in Frameworks */, + AC669361C16100FA4D34D7D1 /* Pods_SwiftSample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 3C394733A73BFFE2995E6DC5 /* Pods */ = { - isa = PBXGroup; - children = ( - D6F1AAEB4FD0559A16605616 /* Pods-SwiftSample.debug.xcconfig */, - 7AD632A1760ED763C0BFFD0A /* Pods-SwiftSample.release.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; 633BFFB91B950B210007E424 = { isa = PBXGroup; children = ( 633BFFC41B950B210007E424 /* SwiftSample */, 633BFFC31B950B210007E424 /* Products */, - 3C394733A73BFFE2995E6DC5 /* Pods */, - B3B46435EDEAE7572BF484F5 /* Frameworks */, + B26D8B90A783952E7BE194D9 /* Pods */, + 66C10D7692132083F1F396C6 /* Frameworks */, ); sourceTree = ""; }; @@ -86,14 +76,24 @@ name = "Supporting Files"; sourceTree = ""; }; - B3B46435EDEAE7572BF484F5 /* Frameworks */ = { + 66C10D7692132083F1F396C6 /* Frameworks */ = { isa = PBXGroup; children = ( - 7D24BFC7BA3339DF6B9A04EF /* Pods_SwiftSample.framework */, + 5CB8E8B90EEE20DEB124EE37 /* Pods_SwiftSample.framework */, ); name = Frameworks; sourceTree = ""; }; + B26D8B90A783952E7BE194D9 /* Pods */ = { + isa = PBXGroup; + children = ( + 544DD51C2905B1B0B00F57F3 /* Pods-SwiftSample.debug.xcconfig */, + FAF69508F6AEB00B2D2EB3F2 /* Pods-SwiftSample.release.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -101,11 +101,11 @@ isa = PBXNativeTarget; buildConfigurationList = 633BFFE11B950B210007E424 /* Build configuration list for PBXNativeTarget "SwiftSample" */; buildPhases = ( - 0BCFE5CC859FA15414AF3B5A /* [CP] Check Pods Manifest.lock */, + 405474DAAC9EB5A0055F82FA /* [CP] Check Pods Manifest.lock */, 633BFFBE1B950B210007E424 /* Sources */, 633BFFBF1B950B210007E424 /* Frameworks */, 633BFFC01B950B210007E424 /* Resources */, - 6998570BEA68700C0183464C /* [CP] Embed Pods Frameworks */, + 983E7AC7007F28ADB66E485B /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -162,7 +162,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0BCFE5CC859FA15414AF3B5A /* [CP] Check Pods Manifest.lock */ = { + 405474DAAC9EB5A0055F82FA /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; 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"; showEnvVarsInLog = 0; }; - 6998570BEA68700C0183464C /* [CP] Embed Pods Frameworks */ = { + 983E7AC7007F28ADB66E485B /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -330,7 +330,7 @@ }; 633BFFE21B950B210007E424 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D6F1AAEB4FD0559A16605616 /* Pods-SwiftSample.debug.xcconfig */; + baseConfigurationReference = 544DD51C2905B1B0B00F57F3 /* Pods-SwiftSample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Info.plist; @@ -345,7 +345,7 @@ }; 633BFFE31B950B210007E424 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AD632A1760ED763C0BFFD0A /* Pods-SwiftSample.release.xcconfig */; + baseConfigurationReference = FAF69508F6AEB00B2D2EB3F2 /* Pods-SwiftSample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Info.plist; diff --git a/src/objective-c/examples/SwiftSample/messages.proto b/src/objective-c/examples/SwiftSample/messages.proto deleted file mode 100644 index 128efd9337e..00000000000 --- a/src/objective-c/examples/SwiftSample/messages.proto +++ /dev/null @@ -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; -} diff --git a/src/objective-c/examples/SwiftSample/test.proto b/src/objective-c/examples/SwiftSample/test.proto deleted file mode 100644 index c5696043630..00000000000 --- a/src/objective-c/examples/SwiftSample/test.proto +++ /dev/null @@ -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); -}