diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc index 1bf0254f5b82dccd32aa4a61e5b90a86fc1646ea..b235911479c2ddb097acd514e5ffec7c96dce141 100644 --- a/src/compiler/objective_c_generator.cc +++ b/src/compiler/objective_c_generator.cc @@ -32,19 +32,20 @@ */ #include <map> +#include <sstream> +#include "src/compiler/config.h" #include "src/compiler/objective_c_generator.h" #include "src/compiler/objective_c_generator_helpers.h" -#include "src/compiler/config.h" - -#include <sstream> +#include <google/protobuf/compiler/objectivec/objectivec_helpers.h> +using ::google::protobuf::compiler::objectivec::ClassName; using ::grpc::protobuf::io::Printer; using ::grpc::protobuf::MethodDescriptor; using ::grpc::protobuf::ServiceDescriptor; -using ::std::map; using ::grpc::string; +using ::std::map; namespace grpc_objective_c_generator { namespace { @@ -69,7 +70,7 @@ void PrintMethodSignature(Printer *printer, if (method->client_streaming()) { printer->Print("RequestsWriter:(id<GRXWriter>)request"); } else { - printer->Print(vars, "Request:($prefix$$request_type$ *)request"); + printer->Print(vars, "Request:($request_class$ *)request"); } // TODO(jcanizales): Put this on a new line and align colons. @@ -78,8 +79,7 @@ void PrintMethodSignature(Printer *printer, if (method->server_streaming()) { printer->Print("BOOL done, "); } - printer->Print(vars, - "$prefix$$response_type$ *response, NSError *error))handler"); + printer->Print(vars, "$response_class$ *response, NSError *error))handler"); } void PrintSimpleSignature(Printer *printer, @@ -99,12 +99,17 @@ void PrintAdvancedSignature(Printer *printer, PrintMethodSignature(printer, method, vars); } +inline map<string, string> GetMethodVars(const MethodDescriptor *method) { + return {{ "method_name", method->name() }, + { "request_type", method->input_type()->name() }, + { "response_type", method->output_type()->name() }, + { "request_class", ClassName(method->input_type()) }, + { "response_class", ClassName(method->output_type()) }}; +} + void PrintMethodDeclarations(Printer *printer, - const MethodDescriptor *method, - map<string, string> vars) { - vars["method_name"] = method->name(); - vars["request_type"] = method->input_type()->name(); - vars["response_type"] = method->output_type()->name(); + const MethodDescriptor *method) { + map<string, string> vars = GetMethodVars(method); PrintProtoRpcDeclarationAsPragma(printer, method, vars); @@ -141,8 +146,7 @@ void PrintAdvancedImplementation(Printer *printer, printer->Print("[GRXWriter writerWithValue:request]\n"); } - printer->Print(vars, - " responseClass:[$prefix$$response_type$ class]\n"); + printer->Print(vars, " responseClass:[$response_class$ class]\n"); printer->Print(" responsesWriteable:[GRXWriteable "); if (method->server_streaming()) { @@ -155,11 +159,8 @@ void PrintAdvancedImplementation(Printer *printer, } void PrintMethodImplementations(Printer *printer, - const MethodDescriptor *method, - map<string, string> vars) { - vars["method_name"] = method->name(); - vars["request_type"] = method->input_type()->name(); - vars["response_type"] = method->output_type()->name(); + const MethodDescriptor *method) { + map<string, string> vars = GetMethodVars(method); PrintProtoRpcDeclarationAsPragma(printer, method, vars); @@ -174,7 +175,7 @@ void PrintMethodImplementations(Printer *printer, } // namespace -string GetHeader(const ServiceDescriptor *service, const string prefix) { +string GetHeader(const ServiceDescriptor *service) { string output; { // Scope the output stream so it closes and finalizes output to the string. @@ -184,19 +185,19 @@ string GetHeader(const ServiceDescriptor *service, const string prefix) { printer.Print("@protocol GRXWriteable;\n"); printer.Print("@protocol GRXWriter;\n\n"); - map<string, string> vars = {{"service_name", service->name()}, - {"prefix", prefix}}; - printer.Print(vars, "@protocol $prefix$$service_name$ <NSObject>\n\n"); + map<string, string> vars = {{"service_class", ServiceClassName(service)}}; + + printer.Print(vars, "@protocol $service_class$ <NSObject>\n\n"); for (int i = 0; i < service->method_count(); i++) { - PrintMethodDeclarations(&printer, service->method(i), vars); + PrintMethodDeclarations(&printer, service->method(i)); } printer.Print("@end\n\n"); printer.Print("// Basic service implementation, over gRPC, that only does" " marshalling and parsing.\n"); - printer.Print(vars, "@interface $prefix$$service_name$ :" - " ProtoService<$prefix$$service_name$>\n"); + printer.Print(vars, "@interface $service_class$ :" + " ProtoService<$service_class$>\n"); printer.Print("- (instancetype)initWithHost:(NSString *)host" " NS_DESIGNATED_INITIALIZER;\n"); printer.Print("@end\n"); @@ -204,7 +205,7 @@ string GetHeader(const ServiceDescriptor *service, const string prefix) { return output; } -string GetSource(const ServiceDescriptor *service, const string prefix) { +string GetSource(const ServiceDescriptor *service) { string output; { // Scope the output stream so it closes and finalizes output to the string. @@ -212,15 +213,15 @@ string GetSource(const ServiceDescriptor *service, const string prefix) { Printer printer(&output_stream, '$'); map<string, string> vars = {{"service_name", service->name()}, - {"package", service->file()->package()}, - {"prefix", prefix}}; + {"service_class", ServiceClassName(service)}, + {"package", service->file()->package()}}; printer.Print(vars, "static NSString *const kPackageName = @\"$package$\";\n"); printer.Print(vars, "static NSString *const kServiceName = @\"$service_name$\";\n\n"); - printer.Print(vars, "@implementation $prefix$$service_name$\n\n"); + printer.Print(vars, "@implementation $service_class$\n\n"); printer.Print("// Designated initializer\n"); printer.Print("- (instancetype)initWithHost:(NSString *)host {\n"); @@ -236,7 +237,7 @@ string GetSource(const ServiceDescriptor *service, const string prefix) { printer.Print("}\n\n\n"); for (int i = 0; i < service->method_count(); i++) { - PrintMethodImplementations(&printer, service->method(i), vars); + PrintMethodImplementations(&printer, service->method(i)); } printer.Print("@end\n"); diff --git a/src/compiler/objective_c_generator.h b/src/compiler/objective_c_generator.h index 548e96fcf1963ee960c5ed377d048b6c7f68451b..40a0c87f99cef46d0167a1bd465d1aead805f1e8 100644 --- a/src/compiler/objective_c_generator.h +++ b/src/compiler/objective_c_generator.h @@ -38,15 +38,16 @@ namespace grpc_objective_c_generator { +using ::grpc::protobuf::ServiceDescriptor; +using ::grpc::string; + // Returns the content to be included in the "global_scope" insertion point of // the generated header file. -grpc::string GetHeader(const grpc::protobuf::ServiceDescriptor *service, - const grpc::string prefix); +string GetHeader(const ServiceDescriptor *service); // Returns the content to be included in the "global_scope" insertion point of // the generated implementation file. -grpc::string GetSource(const grpc::protobuf::ServiceDescriptor *service, - const grpc::string prefix); +string GetSource(const ServiceDescriptor *service); } // namespace grpc_objective_c_generator diff --git a/src/compiler/objective_c_generator_helpers.h b/src/compiler/objective_c_generator_helpers.h index d92a2b5e9affb21dba978d04de53412e45fa0024..1f8c80014f0fac4e4f7866782a0462766793c080 100644 --- a/src/compiler/objective_c_generator_helpers.h +++ b/src/compiler/objective_c_generator_helpers.h @@ -40,9 +40,19 @@ namespace grpc_objective_c_generator { -inline grpc::string MessageHeaderName(const grpc::protobuf::FileDescriptor *file) { +using ::grpc::protobuf::FileDescriptor; +using ::grpc::protobuf::ServiceDescriptor; +using ::grpc::string; + +inline string MessageHeaderName(const FileDescriptor *file) { return grpc_generator::FileNameInUpperCamel(file) + ".pbobjc.h"; } +inline string ServiceClassName(const ServiceDescriptor *service) { + const FileDescriptor *file = service->file(); + string prefix = file->options().objc_class_prefix(); + return prefix + service->name(); +} + } #endif // GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 3cb170e95cfbf7c4166dbc5caf0a7e67267cdb1c..b5ac2bafa99c1720def0051d09dc1353be1b5261 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -77,7 +77,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { string declarations; for (int i = 0; i < file->service_count(); i++) { const grpc::protobuf::ServiceDescriptor *service = file->service(i); - declarations += grpc_objective_c_generator::GetHeader(service, prefix); + declarations += grpc_objective_c_generator::GetHeader(service); } Write(context, file_name + ".pbrpc.h", @@ -95,7 +95,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { string definitions; for (int i = 0; i < file->service_count(); i++) { const grpc::protobuf::ServiceDescriptor *service = file->service(i); - definitions += grpc_objective_c_generator::GetSource(service, prefix); + definitions += grpc_objective_c_generator::GetSource(service); } Write(context, file_name + ".pbrpc.m", imports + '\n' + definitions); diff --git a/src/csharp/Grpc.Tools.nuspec b/src/csharp/Grpc.Tools.nuspec new file mode 100644 index 0000000000000000000000000000000000000000..155c2ef8c44d08d849ad6bf37bb847bd6202517c --- /dev/null +++ b/src/csharp/Grpc.Tools.nuspec @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<package> + <metadata> + <id>Grpc.Tools</id> + <title>gRPC C# Tools</title> + <summary>Tools for C# implementation of gRPC - an RPC library and framework</summary> + <description>Precompiled Windows binaries for generating protocol buffer messages and gRPC client/server code</description> + <version>0.5.0</version> + <authors>Google Inc.</authors> + <owners>grpc-packages</owners> + <licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl> + <projectUrl>https://github.com/grpc/grpc</projectUrl> + <requireLicenseAcceptance>false</requireLicenseAcceptance> + <releaseNotes>protoc.exe - protocol buffer compiler v3.0.0-alpha-3; grpc_csharp_plugin.exe - gRPC C# protoc plugin version 0.5.0</releaseNotes> + <copyright>Copyright 2015, Google Inc.</copyright> + <tags>gRPC RPC Protocol HTTP/2</tags> + </metadata> + <files> + <file src="protoc.exe" target="tools" /> + <file src="grpc_csharp_plugin.exe" target="tools" /> + </files> +</package> diff --git a/src/csharp/Grpc.nuspec b/src/csharp/Grpc.nuspec index b9a76f2c1aef4e937ef101e74bfbec37271f97d9..263e016339eb0aa60e62440450db1c8ac9b13372 100644 --- a/src/csharp/Grpc.nuspec +++ b/src/csharp/Grpc.nuspec @@ -5,7 +5,7 @@ <title>gRPC C#</title> <summary>C# implementation of gRPC - an RPC library and framework</summary> <description>C# implementation of gRPC - an RPC library and framework. See project site for more info.</description> - <version>0.5.0</version> + <version>0.5.0.1</version> <authors>Google Inc.</authors> <owners>grpc-packages</owners> <licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl> @@ -18,8 +18,5 @@ <dependency id="Grpc.Core" version="0.5.0" /> </dependencies> </metadata> - <files> - <file src="protoc.exe" target="tools" /> - <file src="grpc_csharp_plugin.exe" target="tools" /> - </files> + <files/> </package> diff --git a/src/csharp/build_packages.bat b/src/csharp/build_packages.bat index 7cb78bddf4049e14c18a1a6b0e81d851de68bfcb..3412129fb2b1c2fedaf2914942fb5ad988c5b8de 100644 --- a/src/csharp/build_packages.bat +++ b/src/csharp/build_packages.bat @@ -13,6 +13,7 @@ endlocal %NUGET% pack ..\..\vsprojects\nuget_package\grpc.native.csharp_ext.nuspec || goto :error %NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols || goto :error %NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols || goto :error +%NUGET% pack Grpc.Tools.nuspec || goto :error %NUGET% pack Grpc.nuspec || goto :error goto :EOF diff --git a/src/csharp/buildall.bat b/src/csharp/buildall.bat index 34ad9233074a859e146086766ba30fdc6b9ac12d..68c61ef03968fe27bf107cfe4ac4c29f3160a995 100644 --- a/src/csharp/buildall.bat +++ b/src/csharp/buildall.bat @@ -5,7 +5,7 @@ setlocal @call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86 @rem Build the C# native extension -msbuild ..\..\vsprojects\grpc.sln /t:grpc_csharp_ext || goto :error +msbuild ..\..\vsprojects\grpc.sln /t:grpc_csharp_ext /p:PlatformToolset=v120 || goto :error msbuild Grpc.sln /p:Configuration=Debug || goto :error msbuild Grpc.sln /p:Configuration=Release || goto :error diff --git a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m b/src/objective-c/GRPCClient/private/GRPCSecureChannel.m index 47bdfe3f28b94d4e3b38b612dfc086110b138ed6..2cbc6e0f838b35c8e82256a53962324183219948 100644 --- a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m +++ b/src/objective-c/GRPCClient/private/GRPCSecureChannel.m @@ -38,13 +38,17 @@ @implementation GRPCSecureChannel - (instancetype)initWithHost:(NSString *)host { - // TODO(jcanizales): Load certs only once. - NSURL *certsURL = [[NSBundle mainBundle] URLForResource:@"gRPC.bundle/roots" withExtension:@"pem"]; - NSData *certsData = [NSData dataWithContentsOfURL:certsURL]; - NSString *certsString = [[NSString alloc] initWithData:certsData encoding:NSUTF8StringEncoding]; - - grpc_credentials *credentials = grpc_ssl_credentials_create(certsString.UTF8String, NULL); - return (self = [super initWithChannel:grpc_secure_channel_create(credentials, + static const grpc_credentials *kCredentials; + static dispatch_once_t loading; + dispatch_once(&loading, ^{ + // Do not use NSBundle.mainBundle, as it's nil for tests of library projects. + NSBundle *bundle = [NSBundle bundleForClass:self.class]; + NSString *certsPath = [bundle pathForResource:@"gRPC.bundle/roots" ofType:@"pem"]; + NSData *certsData = [NSData dataWithContentsOfFile:certsPath]; + NSString *certsString = [[NSString alloc] initWithData:certsData encoding:NSUTF8StringEncoding]; + kCredentials = grpc_ssl_credentials_create(certsString.UTF8String, NULL); + }); + return (self = [super initWithChannel:grpc_secure_channel_create(kCredentials, host.UTF8String, NULL)]); } diff --git a/src/objective-c/README.md b/src/objective-c/README.md index 167016cc2c3b725d8349680bae074fb389e76823..921eb69231cabb1a7aa8611aa5e7cd23e5a4b7a5 100644 --- a/src/objective-c/README.md +++ b/src/objective-c/README.md @@ -50,13 +50,15 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.8' s.subspec 'Messages' do |ms| - ms.source_files = '*.pbobjc.{h,m}' + ms.source_files = '*.pbobjc.{h,m}', '**/*.pbobjc.{h,m}' + ms.header_mappings_dir = '.' ms.requires_arc = false ms.dependency 'Protobuf', '~> 3.0' end s.subspec 'Services' do |ss| - ss.source_files = '*.pbrpc.{h,m}' + ss.source_files = '*.pbrpc.{h,m}', '**/*.pbrpc.{h,m}' + ss.header_mappings_dir = '.' ss.requires_arc = true ss.dependency 'gRPC', '~> 0.0' ss.dependency '<Podspec file name>/Messages' diff --git a/src/objective-c/examples/Sample/Podfile b/src/objective-c/examples/Sample/Podfile index e8b78647ac0977351e2409759cd7ac8d22b74dee..f3c49c12a17cceb896c7644510da303000ddb480 100644 --- a/src/objective-c/examples/Sample/Podfile +++ b/src/objective-c/examples/Sample/Podfile @@ -3,13 +3,7 @@ platform :ios, '8.0' pod 'gRPC', :path => "../../../.." pod 'Protobuf', :git => 'https://github.com/google/protobuf.git' -pod 'Route_guide', :path => "RouteGuideClient" -pod 'RemoteTest', :path => "RemoteTestClient" - -link_with 'Sample', 'SampleTests' +pod 'RemoteTest', :path => "../../generated_libraries/RemoteTestClient" target 'Sample' do end - -target 'SampleTests' do -end diff --git a/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj b/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj index 17c2255b5a00251fe4082cf681d56913e6e9ec15..611eb6032d5d39ac742bc477473e9813a1f7afd6 100644 --- a/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj +++ b/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj @@ -7,33 +7,16 @@ objects = { /* Begin PBXBuildFile section */ - 60BBBBB15823BBF7639D7AA9 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DC7B7C4C0410F43B9621631 /* libPods.a */; }; - 6340F0491AE66E3300FB6A3D /* RemoteProtoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6340F0481AE66E3300FB6A3D /* RemoteProtoTests.m */; }; - 6356D1DE1AC11FE00075FBBC /* RemoteTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6356D1DD1AC11FE00075FBBC /* RemoteTests.m */; }; 6369A2701A9322E20015FC5C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6369A26F1A9322E20015FC5C /* main.m */; }; 6369A2731A9322E20015FC5C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6369A2721A9322E20015FC5C /* AppDelegate.m */; }; 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 */; }; - 6369A27E1A9322E20015FC5C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6369A27C1A9322E20015FC5C /* LaunchScreen.xib */; }; - 6369A28A1A9322E20015FC5C /* SampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6369A2891A9322E20015FC5C /* SampleTests.m */; }; FC81FE63CA655031F3524EC0 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DC7B7C4C0410F43B9621631 /* libPods.a */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 6369A2841A9322E20015FC5C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6369A2621A9322E20015FC5C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6369A2691A9322E20015FC5C; - remoteInfo = Sample; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXFileReference section */ 2DC7B7C4C0410F43B9621631 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 6340F0481AE66E3300FB6A3D /* RemoteProtoTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RemoteProtoTests.m; sourceTree = "<group>"; }; - 6356D1DD1AC11FE00075FBBC /* RemoteTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RemoteTests.m; sourceTree = "<group>"; }; 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>"; }; 6369A26F1A9322E20015FC5C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; @@ -43,10 +26,6 @@ 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>"; }; 6369A27A1A9322E20015FC5C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; - 6369A27D1A9322E20015FC5C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; }; - 6369A2831A9322E20015FC5C /* SampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 6369A2881A9322E20015FC5C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; - 6369A2891A9322E20015FC5C /* SampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SampleTests.m; sourceTree = "<group>"; }; AC29DD6FCDF962F519FEBB0D /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; }; C68330F8D451CC6ACEABA09F /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; }; /* End PBXFileReference section */ @@ -60,14 +39,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 6369A2801A9322E20015FC5C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 60BBBBB15823BBF7639D7AA9 /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -75,7 +46,6 @@ isa = PBXGroup; children = ( 6369A26C1A9322E20015FC5C /* Sample */, - 6369A2861A9322E20015FC5C /* SampleTests */, 6369A26B1A9322E20015FC5C /* Products */, AB3331C9AE6488E61B2B094E /* Pods */, C4C2C5219053E079C9EFB930 /* Frameworks */, @@ -86,7 +56,6 @@ isa = PBXGroup; children = ( 6369A26A1A9322E20015FC5C /* Sample.app */, - 6369A2831A9322E20015FC5C /* SampleTests.xctest */, ); name = Products; sourceTree = "<group>"; @@ -100,7 +69,6 @@ 6369A2751A9322E20015FC5C /* ViewController.m */, 6369A2771A9322E20015FC5C /* Main.storyboard */, 6369A27A1A9322E20015FC5C /* Images.xcassets */, - 6369A27C1A9322E20015FC5C /* LaunchScreen.xib */, 6369A26D1A9322E20015FC5C /* Supporting Files */, ); path = Sample; @@ -115,25 +83,6 @@ name = "Supporting Files"; sourceTree = "<group>"; }; - 6369A2861A9322E20015FC5C /* SampleTests */ = { - isa = PBXGroup; - children = ( - 6340F0481AE66E3300FB6A3D /* RemoteProtoTests.m */, - 6369A2891A9322E20015FC5C /* SampleTests.m */, - 6369A2871A9322E20015FC5C /* Supporting Files */, - 6356D1DD1AC11FE00075FBBC /* RemoteTests.m */, - ); - path = SampleTests; - sourceTree = "<group>"; - }; - 6369A2871A9322E20015FC5C /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 6369A2881A9322E20015FC5C /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = "<group>"; - }; AB3331C9AE6488E61B2B094E /* Pods */ = { isa = PBXGroup; children = ( @@ -173,26 +122,6 @@ productReference = 6369A26A1A9322E20015FC5C /* Sample.app */; productType = "com.apple.product-type.application"; }; - 6369A2821A9322E20015FC5C /* SampleTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6369A2901A9322E20015FC5C /* Build configuration list for PBXNativeTarget "SampleTests" */; - buildPhases = ( - 75C393B2FDC60A22B2121058 /* Check Pods Manifest.lock */, - 6369A27F1A9322E20015FC5C /* Sources */, - 6369A2801A9322E20015FC5C /* Frameworks */, - 6369A2811A9322E20015FC5C /* Resources */, - 7B8CDC152F76D6014A96C798 /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 6369A2851A9322E20015FC5C /* PBXTargetDependency */, - ); - name = SampleTests; - productName = SampleTests; - productReference = 6369A2831A9322E20015FC5C /* SampleTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -205,10 +134,6 @@ 6369A2691A9322E20015FC5C = { CreatedOnToolsVersion = 6.1.1; }; - 6369A2821A9322E20015FC5C = { - CreatedOnToolsVersion = 6.1.1; - TestTargetID = 6369A2691A9322E20015FC5C; - }; }; }; buildConfigurationList = 6369A2651A9322E20015FC5C /* Build configuration list for PBXProject "Sample" */; @@ -225,7 +150,6 @@ projectRoot = ""; targets = ( 6369A2691A9322E20015FC5C /* Sample */, - 6369A2821A9322E20015FC5C /* SampleTests */, ); }; /* End PBXProject section */ @@ -236,18 +160,10 @@ buildActionMask = 2147483647; files = ( 6369A2791A9322E20015FC5C /* Main.storyboard in Resources */, - 6369A27E1A9322E20015FC5C /* LaunchScreen.xib in Resources */, 6369A27B1A9322E20015FC5C /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 6369A2811A9322E20015FC5C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -281,36 +197,6 @@ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; - 75C393B2FDC60A22B2121058 /* Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 7B8CDC152F76D6014A96C798 /* Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -324,26 +210,8 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 6369A27F1A9322E20015FC5C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6369A28A1A9322E20015FC5C /* SampleTests.m in Sources */, - 6340F0491AE66E3300FB6A3D /* RemoteProtoTests.m in Sources */, - 6356D1DE1AC11FE00075FBBC /* RemoteTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 6369A2851A9322E20015FC5C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 6369A2691A9322E20015FC5C /* Sample */; - targetProxy = 6369A2841A9322E20015FC5C /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ 6369A2771A9322E20015FC5C /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -353,14 +221,6 @@ name = Main.storyboard; sourceTree = "<group>"; }; - 6369A27C1A9322E20015FC5C /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 6369A27D1A9322E20015FC5C /* Base */, - ); - name = LaunchScreen.xib; - sourceTree = "<group>"; - }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -464,42 +324,6 @@ }; name = Release; }; - 6369A2911A9322E20015FC5C /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AC29DD6FCDF962F519FEBB0D /* Pods.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = SampleTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; - }; - name = Debug; - }; - 6369A2921A9322E20015FC5C /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C68330F8D451CC6ACEABA09F /* Pods.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = SampleTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -521,15 +345,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 6369A2901A9322E20015FC5C /* Build configuration list for PBXNativeTarget "SampleTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6369A2911A9322E20015FC5C /* Debug */, - 6369A2921A9322E20015FC5C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 6369A2621A9322E20015FC5C /* Project object */; diff --git a/src/objective-c/examples/Sample/Sample/AppDelegate.h b/src/objective-c/examples/Sample/Sample/AppDelegate.h index b1857f28e085296371588bda81f72275bc3b911a..102e7f3adea8c5c80e234ba890f16a96d42826e5 100644 --- a/src/objective-c/examples/Sample/Sample/AppDelegate.h +++ b/src/objective-c/examples/Sample/Sample/AppDelegate.h @@ -34,8 +34,5 @@ #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> - @property (strong, nonatomic) UIWindow *window; - @end - diff --git a/src/objective-c/examples/Sample/Sample/AppDelegate.m b/src/objective-c/examples/Sample/Sample/AppDelegate.m index 12e1ad9d676c3cde59e1653ca4a8f59c98174c09..a38e36651ed276cf24213087348cd932c5164ba8 100644 --- a/src/objective-c/examples/Sample/Sample/AppDelegate.m +++ b/src/objective-c/examples/Sample/Sample/AppDelegate.m @@ -33,13 +33,5 @@ #import "AppDelegate.h" -@interface AppDelegate () -@end - @implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - return YES; -} - @end diff --git a/src/objective-c/examples/Sample/Sample/Base.lproj/LaunchScreen.xib b/src/objective-c/examples/Sample/Sample/Base.lproj/LaunchScreen.xib deleted file mode 100644 index c51a8e199eb454ca06bcd9fb6d6b2d60e1d55f49..0000000000000000000000000000000000000000 --- a/src/objective-c/examples/Sample/Sample/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> - <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/> - <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> - </dependencies> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <view contentMode="scaleToFill" id="iN0-l3-epB"> - <rect key="frame" x="0.0" y="0.0" width="480" height="480"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <subviews> - <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 gRPC. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye"> - <rect key="frame" x="20" y="439" width="441" height="21"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> - <rect key="frame" x="20" y="140" width="441" height="43"/> - <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> - <nil key="highlightedColor"/> - </label> - </subviews> - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> - <constraints> - <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/> - <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/> - <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/> - <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/> - <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/> - <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/> - </constraints> - <nil key="simulatedStatusBarMetrics"/> - <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> - <point key="canvasLocation" x="548" y="455"/> - </view> - </objects> -</document> diff --git a/src/objective-c/examples/Sample/Sample/Base.lproj/Main.storyboard b/src/objective-c/examples/Sample/Sample/Base.lproj/Main.storyboard index f56d2f3bb56e8474d49393008be744986bd41c3c..8887b9e19ff89c3bedab8124fea1271094695b43 100644 --- a/src/objective-c/examples/Sample/Sample/Base.lproj/Main.storyboard +++ b/src/objective-c/examples/Sample/Sample/Base.lproj/Main.storyboard @@ -1,13 +1,14 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14D131" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/> + <capability name="Constraints to layout margins" minToolsVersion="6.0"/> </dependencies> <scenes> <!--View Controller--> <scene sceneID="tne-QT-ifu"> <objects> - <viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController"> + <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController"> <layoutGuides> <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> @@ -15,7 +16,38 @@ <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BWr-eN-L3y"> + <rect key="frame" x="16" y="20" width="568" height="150"/> + <constraints> + <constraint firstAttribute="width" constant="385" id="exg-IV-Kl0"/> + </constraints> + <string key="text">Sample app launch finished. +Check ViewController.m for the gRPC calls made, and the logs of this app for their results. +(You may need to make XCode's Debug Area visible).</string> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> + <nil key="highlightedColor"/> + <variation key="default"> + <mask key="constraints"> + <exclude reference="exg-IV-Kl0"/> + </mask> + </variation> + </label> + </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> + <constraints> + <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="BWr-eN-L3y" secondAttribute="bottom" constant="430" id="KFC-7p-hRl"/> + <constraint firstAttribute="trailing" secondItem="BWr-eN-L3y" secondAttribute="trailing" constant="16" id="M9C-nN-tFv"/> + <constraint firstItem="BWr-eN-L3y" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="SaP-0S-2LK"/> + <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="BWr-eN-L3y" secondAttribute="bottom" id="wjC-O4-kJg"/> + <constraint firstItem="BWr-eN-L3y" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" id="ygF-6t-hrg"/> + </constraints> + <variation key="default"> + <mask key="constraints"> + <exclude reference="KFC-7p-hRl"/> + </mask> + </variation> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> diff --git a/src/objective-c/examples/Sample/Sample/Info.plist b/src/objective-c/examples/Sample/Sample/Info.plist index ffdc8b30122ff1eb90e0944e79feaaf9aefbf7f8..4436635ab4e1f21cabc02acf501fd499342b4419 100644 --- a/src/objective-c/examples/Sample/Sample/Info.plist +++ b/src/objective-c/examples/Sample/Sample/Info.plist @@ -23,7 +23,7 @@ <key>LSRequiresIPhoneOS</key> <true/> <key>UILaunchStoryboardName</key> - <string>LaunchScreen</string> + <string>Main</string> <key>UIMainStoryboardFile</key> <string>Main</string> <key>UIRequiredDeviceCapabilities</key> diff --git a/src/objective-c/examples/Sample/Sample/ViewController.m b/src/objective-c/examples/Sample/Sample/ViewController.m index 9b331fe43fb0705b7ca6e498e5e62230719845e6..0011a4508df6bcfbc3e560a173dc3616e2cf88af 100644 --- a/src/objective-c/examples/Sample/Sample/ViewController.m +++ b/src/objective-c/examples/Sample/Sample/ViewController.m @@ -40,9 +40,6 @@ #import <RemoteTest/Messages.pbobjc.h> #import <RemoteTest/Test.pbrpc.h> -@interface ViewController () -@end - @implementation ViewController - (void)viewDidLoad { diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Empty.pbobjc.h b/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.h similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/Empty.pbobjc.h rename to src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.h diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Empty.pbobjc.m b/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.m similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/Empty.pbobjc.m rename to src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.m diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Messages.pbobjc.h b/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.h similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/Messages.pbobjc.h rename to src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.h diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Messages.pbobjc.m b/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.m similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/Messages.pbobjc.m rename to src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.m diff --git a/src/objective-c/examples/Sample/RemoteTestClient/RemoteTest.podspec b/src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/RemoteTest.podspec rename to src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Test.pbobjc.h b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.h similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/Test.pbobjc.h rename to src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.h diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Test.pbobjc.m b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.m similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/Test.pbobjc.m rename to src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.m diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Test.pbrpc.h b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.h similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/Test.pbrpc.h rename to src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.h diff --git a/src/objective-c/examples/Sample/RemoteTestClient/Test.pbrpc.m b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.m similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/Test.pbrpc.m rename to src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.m diff --git a/src/objective-c/examples/Sample/RemoteTestClient/empty.proto b/src/objective-c/generated_libraries/RemoteTestClient/empty.proto similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/empty.proto rename to src/objective-c/generated_libraries/RemoteTestClient/empty.proto diff --git a/src/objective-c/examples/Sample/RemoteTestClient/messages.proto b/src/objective-c/generated_libraries/RemoteTestClient/messages.proto similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/messages.proto rename to src/objective-c/generated_libraries/RemoteTestClient/messages.proto diff --git a/src/objective-c/examples/Sample/RemoteTestClient/test.proto b/src/objective-c/generated_libraries/RemoteTestClient/test.proto similarity index 100% rename from src/objective-c/examples/Sample/RemoteTestClient/test.proto rename to src/objective-c/generated_libraries/RemoteTestClient/test.proto diff --git a/src/objective-c/examples/Sample/RouteGuideClient/RouteGuide.pbobjc.h b/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.h similarity index 100% rename from src/objective-c/examples/Sample/RouteGuideClient/RouteGuide.pbobjc.h rename to src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.h diff --git a/src/objective-c/examples/Sample/RouteGuideClient/RouteGuide.pbobjc.m b/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.m similarity index 100% rename from src/objective-c/examples/Sample/RouteGuideClient/RouteGuide.pbobjc.m rename to src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.m diff --git a/src/objective-c/examples/Sample/RouteGuideClient/RouteGuide.pbrpc.h b/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.h similarity index 100% rename from src/objective-c/examples/Sample/RouteGuideClient/RouteGuide.pbrpc.h rename to src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.h diff --git a/src/objective-c/examples/Sample/RouteGuideClient/RouteGuide.pbrpc.m b/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.m similarity index 100% rename from src/objective-c/examples/Sample/RouteGuideClient/RouteGuide.pbrpc.m rename to src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.m diff --git a/src/objective-c/examples/Sample/RouteGuideClient/Route_guide.podspec b/src/objective-c/generated_libraries/RouteGuideClient/Route_guide.podspec similarity index 100% rename from src/objective-c/examples/Sample/RouteGuideClient/Route_guide.podspec rename to src/objective-c/generated_libraries/RouteGuideClient/Route_guide.podspec diff --git a/src/objective-c/examples/Sample/RouteGuideClient/route_guide.proto b/src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto similarity index 100% rename from src/objective-c/examples/Sample/RouteGuideClient/route_guide.proto rename to src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto diff --git a/src/objective-c/examples/Sample/SampleTests/RemoteTests.m b/src/objective-c/tests/GRPCClientTests.m similarity index 96% rename from src/objective-c/examples/Sample/SampleTests/RemoteTests.m rename to src/objective-c/tests/GRPCClientTests.m index ceb72cfaecb4c76341b4fcab12b047e9f6888e24..713ea2848a1048c6f5d03e48f33a7115d378375e 100644 --- a/src/objective-c/examples/Sample/SampleTests/RemoteTests.m +++ b/src/objective-c/tests/GRPCClientTests.m @@ -40,10 +40,13 @@ #import <gRPC/GRXWriteable.h> #import <RemoteTest/Messages.pbobjc.h> -@interface RemoteTests : XCTestCase +// These are a few tests similar to InteropTests, but which use the generic gRPC client (GRPCCall) +// rather than a generated proto library on top of it. + +@interface GRPCClientTests : XCTestCase @end -@implementation RemoteTests +@implementation GRPCClientTests - (void)testConnectionToRemoteServer { __weak XCTestExpectation *expectation = [self expectationWithDescription:@"Server reachable."]; diff --git a/src/objective-c/examples/Sample/SampleTests/Info.plist b/src/objective-c/tests/Info.plist similarity index 91% rename from src/objective-c/examples/Sample/SampleTests/Info.plist rename to src/objective-c/tests/Info.plist index f547b0b70726345b5530f7396813317802f44487..fbeeb96ba6cb24080092b014db710833e4c62b62 100644 --- a/src/objective-c/examples/Sample/SampleTests/Info.plist +++ b/src/objective-c/tests/Info.plist @@ -7,7 +7,7 @@ <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> - <string>org.grpc.$(PRODUCT_NAME:rfc1034identifier)</string> + <string>gRPC.$(PRODUCT_NAME:rfc1034identifier)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> diff --git a/src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m b/src/objective-c/tests/InteropTests.m similarity index 97% rename from src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m rename to src/objective-c/tests/InteropTests.m index 8e0e11d23da6445b1b3f86d336e44536ab2fb626..0a512c17dcb25eb9699dd6472468ba9d220c1cad 100644 --- a/src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m +++ b/src/objective-c/tests/InteropTests.m @@ -76,10 +76,10 @@ } @end -@interface RemoteProtoTests : XCTestCase +@interface InteropTests : XCTestCase @end -@implementation RemoteProtoTests { +@implementation InteropTests { RMTTestService *_service; } @@ -192,7 +192,7 @@ [expectation fulfill]; } }]; - + [self waitForExpectationsWithTimeout:4 handler:nil]; } @@ -230,7 +230,7 @@ [requestsBuffer writesFinishedWithError:nil]; } } - + if (done) { XCTAssertEqual(index, 4, @"Received %i responses instead of 4.", index); [expectation fulfill]; @@ -283,9 +283,9 @@ [requestsBuffer writeValue:request]; __block ProtoRPC *call = [_service RPCToFullDuplexCallWithRequestsWriter:requestsBuffer - handler:^(BOOL done, - RMTStreamingOutputCallResponse *response, - NSError *error) { + handler:^(BOOL done, + RMTStreamingOutputCallResponse *response, + NSError *error) { if (receivedResponse) { XCTAssert(done, @"Unexpected extra response %@", response); XCTAssertEqual(error.code, GRPC_STATUS_CANCELLED); diff --git a/src/objective-c/examples/Sample/SampleTests/SampleTests.m b/src/objective-c/tests/LocalClearTextTests.m similarity index 94% rename from src/objective-c/examples/Sample/SampleTests/SampleTests.m rename to src/objective-c/tests/LocalClearTextTests.m index 83cfd8c1b593de15e12e1a2343dfce3f9d834c29..6a9496b623a6573c7bdc874dc4e381a598a4f0ce 100644 --- a/src/objective-c/examples/Sample/SampleTests/SampleTests.m +++ b/src/objective-c/tests/LocalClearTextTests.m @@ -41,13 +41,14 @@ #import <Route_guide/RouteGuide.pbobjc.h> #import <Route_guide/RouteGuide.pbrpc.h> -@interface SampleTests : XCTestCase +// These tests require the gRPC-Java "RouteGuide" sample server to be running locally. To do so, +// install Gradle by following the instructions here: https://docs.gradle.org/current/userguide/installation.html +// And use it to run the server by following the instructions here: https://github.com/grpc/grpc-java/tree/master/examples + +@interface LocalClearTextTests : XCTestCase @end -// These tests require the gRPC-Java "RouteGuide" sample server to be running locally. Install the -// gRPC-Java library following the instructions here: https://github.com/grpc/grpc-java And run the -// server by following the instructions here: https://github.com/grpc/grpc-java/tree/master/examples -@implementation SampleTests +@implementation LocalClearTextTests - (void)testConnectionToLocalServer { __weak XCTestExpectation *expectation = [self expectationWithDescription:@"Server reachable."]; diff --git a/src/objective-c/tests/Podfile b/src/objective-c/tests/Podfile new file mode 100644 index 0000000000000000000000000000000000000000..c099fb518236d113385c8cd5371925137e21c5de --- /dev/null +++ b/src/objective-c/tests/Podfile @@ -0,0 +1,15 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '8.0' + +pod 'gRPC', :path => "../../.." +pod 'Protobuf', :git => 'https://github.com/google/protobuf.git' +pod 'RemoteTest', :path => "../generated_libraries/RemoteTestClient" +pod 'Route_guide', :path => "../generated_libraries/RouteGuideClient" + +link_with 'AllTests' + +target 'Tests' do +end + +target 'AllTests' do +end diff --git a/src/objective-c/tests/RxLibraryUnitTests.m b/src/objective-c/tests/RxLibraryUnitTests.m new file mode 100644 index 0000000000000000000000000000000000000000..89984d9481ce85b228c6c1d43cd0b28fad332641 --- /dev/null +++ b/src/objective-c/tests/RxLibraryUnitTests.m @@ -0,0 +1,140 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#import <UIKit/UIKit.h> +#import <XCTest/XCTest.h> + +#import <gRPC/GRXBufferedPipe.h> +#import <gRPC/GRXWriter.h> +#import <gRPC/GRXWriteable.h> + +// A mock of a GRXSingleValueHandler block that can be queried for how many times it was called and +// what were the last values passed to it. +// +// TODO(jcanizales): Move this to a test util library, and add tests for it. +@interface CapturingSingleValueHandler : NSObject +@property (nonatomic, readonly) void (^block)(id value, NSError *errorOrNil); +@property (nonatomic, readonly) NSUInteger timesCalled; +@property (nonatomic, readonly) id value; +@property (nonatomic, readonly) NSError *errorOrNil; ++ (instancetype)handler; +@end + +@implementation CapturingSingleValueHandler ++ (instancetype)handler { + return [[self alloc] init]; +} + +- (GRXSingleValueHandler)block { + return ^(id value, NSError *errorOrNil) { + ++_timesCalled; + _value = value; + _errorOrNil = errorOrNil; + }; +} +@end + +@interface RxLibraryUnitTests : XCTestCase +@end + +@implementation RxLibraryUnitTests + +#pragma mark Writeable + +- (void)testWriteableSingleValueHandlerIsCalledForValue { + // Given: + CapturingSingleValueHandler *handler = [CapturingSingleValueHandler handler]; + id anyValue = @7; + + // If: + id<GRXWriteable> writeable = [GRXWriteable writeableWithSingleValueHandler:handler.block]; + [writeable writeValue:anyValue]; + + // Then: + XCTAssertEqual(handler.timesCalled, 1); + XCTAssertEqualObjects(handler.value, anyValue); + XCTAssertEqualObjects(handler.errorOrNil, nil); +} + +- (void)testWriteableSingleValueHandlerIsCalledForError { + // Given: + CapturingSingleValueHandler *handler = [CapturingSingleValueHandler handler]; + NSError *anyError = [NSError errorWithDomain:@"domain" code:7 userInfo:nil]; + + // If: + id<GRXWriteable> writeable = [GRXWriteable writeableWithSingleValueHandler:handler.block]; + [writeable writesFinishedWithError:anyError]; + + // Then: + XCTAssertEqual(handler.timesCalled, 1); + XCTAssertEqualObjects(handler.value, nil); + XCTAssertEqualObjects(handler.errorOrNil, anyError); +} + +#pragma mark BufferedPipe + +- (void)testBufferedPipePropagatesValue { + // Given: + CapturingSingleValueHandler *handler = [CapturingSingleValueHandler handler]; + id<GRXWriteable> writeable = [GRXWriteable writeableWithSingleValueHandler:handler.block]; + id anyValue = @7; + + // If: + GRXBufferedPipe *pipe = [GRXBufferedPipe pipe]; + [pipe startWithWriteable:writeable]; + [pipe writeValue:anyValue]; + + // Then: + XCTAssertEqual(handler.timesCalled, 1); + XCTAssertEqualObjects(handler.value, anyValue); + XCTAssertEqualObjects(handler.errorOrNil, nil); +} + +- (void)testBufferedPipePropagatesError { + // Given: + CapturingSingleValueHandler *handler = [CapturingSingleValueHandler handler]; + id<GRXWriteable> writeable = [GRXWriteable writeableWithSingleValueHandler:handler.block]; + NSError *anyError = [NSError errorWithDomain:@"domain" code:7 userInfo:nil]; + + // If: + GRXBufferedPipe *pipe = [GRXBufferedPipe pipe]; + [pipe startWithWriteable:writeable]; + [pipe writesFinishedWithError:anyError]; + + // Then: + XCTAssertEqual(handler.timesCalled, 1); + XCTAssertEqualObjects(handler.value, nil); + XCTAssertEqualObjects(handler.errorOrNil, anyError); +} + +@end diff --git a/src/objective-c/tests/Tests.m b/src/objective-c/tests/Tests.m new file mode 100644 index 0000000000000000000000000000000000000000..b821d3872060a6a6977e462bafcb9423c2e12b29 --- /dev/null +++ b/src/objective-c/tests/Tests.m @@ -0,0 +1,40 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#import <Foundation/Foundation.h> + +@interface Tests : NSObject +@end + +@implementation Tests +@end diff --git a/src/objective-c/tests/Tests.xcodeproj/project.pbxproj b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj new file mode 100644 index 0000000000000000000000000000000000000000..34be705db2b2d0c641d27436797d2a415a274fe3 --- /dev/null +++ b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj @@ -0,0 +1,442 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6312AE4E1B1BF49B00341DEE /* GRPCClientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6312AE4D1B1BF49B00341DEE /* GRPCClientTests.m */; }; + 63175DFF1B1B9FAF00027841 /* LocalClearTextTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 63175DFE1B1B9FAF00027841 /* LocalClearTextTests.m */; }; + 63423F4A1B150A5F006CF63C /* libTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 635697C71B14FC11007A7283 /* libTests.a */; }; + 63423F511B151B77006CF63C /* RxLibraryUnitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 63423F501B151B77006CF63C /* RxLibraryUnitTests.m */; }; + 635697CD1B14FC11007A7283 /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 635697CC1B14FC11007A7283 /* Tests.m */; }; + 635ED2EC1B1A3BC400FDE5C3 /* InteropTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 635ED2EB1B1A3BC400FDE5C3 /* InteropTests.m */; }; + 7D8A186224D39101F90230F6 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 35F2B6BF3BAE8F0DC4AFD76E /* libPods.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63423F4B1B150A5F006CF63C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 635697BF1B14FC11007A7283 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 635697C61B14FC11007A7283; + remoteInfo = Tests; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 635697C51B14FC11007A7283 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0A4F89D9C90E9C30990218F0 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; }; + 35F2B6BF3BAE8F0DC4AFD76E /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 6312AE4D1B1BF49B00341DEE /* GRPCClientTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GRPCClientTests.m; sourceTree = "<group>"; }; + 63175DFE1B1B9FAF00027841 /* LocalClearTextTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LocalClearTextTests.m; sourceTree = "<group>"; }; + 63423F441B150A5F006CF63C /* AllTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AllTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63423F501B151B77006CF63C /* RxLibraryUnitTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RxLibraryUnitTests.m; sourceTree = "<group>"; }; + 635697C71B14FC11007A7283 /* libTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTests.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 635697CC1B14FC11007A7283 /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; }; + 635697D81B14FC11007A7283 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; + 635ED2EB1B1A3BC400FDE5C3 /* InteropTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InteropTests.m; sourceTree = "<group>"; }; + FF7B5489BCFE40111D768DD0 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63423F411B150A5F006CF63C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63423F4A1B150A5F006CF63C /* libTests.a in Frameworks */, + 7D8A186224D39101F90230F6 /* libPods.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 635697C41B14FC11007A7283 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 136D535E19727099B941D7B1 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 35F2B6BF3BAE8F0DC4AFD76E /* libPods.a */, + ); + name = Frameworks; + sourceTree = "<group>"; + }; + 51E4650F34F854F41FF053B3 /* Pods */ = { + isa = PBXGroup; + children = ( + FF7B5489BCFE40111D768DD0 /* Pods.debug.xcconfig */, + 0A4F89D9C90E9C30990218F0 /* Pods.release.xcconfig */, + ); + name = Pods; + sourceTree = "<group>"; + }; + 635697BE1B14FC11007A7283 = { + isa = PBXGroup; + children = ( + 635697C91B14FC11007A7283 /* Tests */, + 635697C81B14FC11007A7283 /* Products */, + 51E4650F34F854F41FF053B3 /* Pods */, + 136D535E19727099B941D7B1 /* Frameworks */, + ); + sourceTree = "<group>"; + }; + 635697C81B14FC11007A7283 /* Products */ = { + isa = PBXGroup; + children = ( + 635697C71B14FC11007A7283 /* libTests.a */, + 63423F441B150A5F006CF63C /* AllTests.xctest */, + ); + name = Products; + sourceTree = "<group>"; + }; + 635697C91B14FC11007A7283 /* Tests */ = { + isa = PBXGroup; + children = ( + 6312AE4D1B1BF49B00341DEE /* GRPCClientTests.m */, + 63175DFE1B1B9FAF00027841 /* LocalClearTextTests.m */, + 635ED2EB1B1A3BC400FDE5C3 /* InteropTests.m */, + 63423F501B151B77006CF63C /* RxLibraryUnitTests.m */, + 635697CC1B14FC11007A7283 /* Tests.m */, + 635697D71B14FC11007A7283 /* Supporting Files */, + ); + name = Tests; + sourceTree = SOURCE_ROOT; + }; + 635697D71B14FC11007A7283 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 635697D81B14FC11007A7283 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 63423F431B150A5F006CF63C /* AllTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63423F4D1B150A5F006CF63C /* Build configuration list for PBXNativeTarget "AllTests" */; + buildPhases = ( + 914ADDD7106BA9BB8A7E569F /* Check Pods Manifest.lock */, + 63423F401B150A5F006CF63C /* Sources */, + 63423F411B150A5F006CF63C /* Frameworks */, + 63423F421B150A5F006CF63C /* Resources */, + A441F71824DCB9D0CA297748 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + 63423F4C1B150A5F006CF63C /* PBXTargetDependency */, + ); + name = AllTests; + productName = AllTests; + productReference = 63423F441B150A5F006CF63C /* AllTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 635697C61B14FC11007A7283 /* Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 635697DB1B14FC11007A7283 /* Build configuration list for PBXNativeTarget "Tests" */; + buildPhases = ( + 635697C31B14FC11007A7283 /* Sources */, + 635697C41B14FC11007A7283 /* Frameworks */, + 635697C51B14FC11007A7283 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Tests; + productName = Tests; + productReference = 635697C71B14FC11007A7283 /* libTests.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 635697BF1B14FC11007A7283 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0630; + ORGANIZATIONNAME = gRPC; + TargetAttributes = { + 63423F431B150A5F006CF63C = { + CreatedOnToolsVersion = 6.3.1; + }; + 635697C61B14FC11007A7283 = { + CreatedOnToolsVersion = 6.3.1; + }; + }; + }; + buildConfigurationList = 635697C21B14FC11007A7283 /* Build configuration list for PBXProject "Tests" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 635697BE1B14FC11007A7283; + productRefGroup = 635697C81B14FC11007A7283 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 635697C61B14FC11007A7283 /* Tests */, + 63423F431B150A5F006CF63C /* AllTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 63423F421B150A5F006CF63C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 914ADDD7106BA9BB8A7E569F /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + A441F71824DCB9D0CA297748 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63423F401B150A5F006CF63C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63175DFF1B1B9FAF00027841 /* LocalClearTextTests.m in Sources */, + 63423F511B151B77006CF63C /* RxLibraryUnitTests.m in Sources */, + 6312AE4E1B1BF49B00341DEE /* GRPCClientTests.m in Sources */, + 635ED2EC1B1A3BC400FDE5C3 /* InteropTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 635697C31B14FC11007A7283 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 635697CD1B14FC11007A7283 /* Tests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63423F4C1B150A5F006CF63C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 635697C61B14FC11007A7283 /* Tests */; + targetProxy = 63423F4B1B150A5F006CF63C /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63423F4E1B150A5F006CF63C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FF7B5489BCFE40111D768DD0 /* Pods.debug.xcconfig */; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 63423F4F1B150A5F006CF63C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0A4F89D9C90E9C30990218F0 /* Pods.release.xcconfig */; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 635697D91B14FC11007A7283 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 635697DA1B14FC11007A7283 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 635697DC1B14FC11007A7283 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 635697DD1B14FC11007A7283 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63423F4D1B150A5F006CF63C /* Build configuration list for PBXNativeTarget "AllTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63423F4E1B150A5F006CF63C /* Debug */, + 63423F4F1B150A5F006CF63C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 635697C21B14FC11007A7283 /* Build configuration list for PBXProject "Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 635697D91B14FC11007A7283 /* Debug */, + 635697DA1B14FC11007A7283 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 635697DB1B14FC11007A7283 /* Build configuration list for PBXNativeTarget "Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 635697DC1B14FC11007A7283 /* Debug */, + 635697DD1B14FC11007A7283 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 635697BF1B14FC11007A7283 /* Project object */; +} diff --git a/src/objective-c/tests/Tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/src/objective-c/tests/Tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000000000000000000000000000000000..6c0ea849302f5f67cb4394510d54b58c7e223883 --- /dev/null +++ b/src/objective-c/tests/Tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Workspace + version = "1.0"> + <FileRef + location = "self:Tests.xcodeproj"> + </FileRef> +</Workspace> diff --git a/test/core/security/auth_context_test.c b/test/core/security/auth_context_test.c index 54548bf1fc1c3a346db6d2e60feb684aebb34d9f..2fb0c01f6f2c8cbc9a7ba3270eea6409d88f36d7 100644 --- a/test/core/security/auth_context_test.c +++ b/test/core/security/auth_context_test.c @@ -43,7 +43,7 @@ static void test_empty_context(void) { grpc_auth_context *ctx = grpc_auth_context_create(NULL, 0); grpc_auth_property_iterator it; - gpr_log(GPR_INFO, __FUNCTION__); + gpr_log(GPR_INFO, "test_empty_context"); GPR_ASSERT(ctx != NULL); GPR_ASSERT(grpc_auth_context_peer_identity_property_name(ctx) == NULL); it = grpc_auth_context_peer_identity(ctx); @@ -60,7 +60,7 @@ static void test_simple_context(void) { grpc_auth_property_iterator it; size_t i; - gpr_log(GPR_INFO, __FUNCTION__); + gpr_log(GPR_INFO, "test_simple_context"); GPR_ASSERT(ctx != NULL); GPR_ASSERT(ctx->property_count == 3); ctx->properties[0] = grpc_auth_property_init_from_cstring("name", "chapi"); @@ -95,7 +95,7 @@ static void test_chained_context(void) { grpc_auth_property_iterator it; size_t i; - gpr_log(GPR_INFO, __FUNCTION__); + gpr_log(GPR_INFO, "test_chained_context"); grpc_auth_context_unref(chained); chained->properties[0] = grpc_auth_property_init_from_cstring("name", "padapo"); diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 609b6c657d9d3c57d1e9c9218a7f07c96bc77621..bd5959cd00011124bbf4f44fb73add32187a7dac 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -149,7 +149,7 @@ class NodeLanguage(object): environ={'GRPC_TRACE': 'surface,batch'})] def make_targets(self): - return ['static_c'] + return ['static_c', 'shared_c'] def build_steps(self): return [['tools/run_tests/build_node.sh']] @@ -168,7 +168,7 @@ class PhpLanguage(object): environ={'GRPC_TRACE': 'surface,batch'})] def make_targets(self): - return ['static_c'] + return ['static_c', 'shared_c'] def build_steps(self): return [['tools/run_tests/build_php.sh']] @@ -202,7 +202,7 @@ class PythonLanguage(object): return files + modules def make_targets(self): - return ['static_c', 'grpc_python_plugin'] + return ['static_c', 'grpc_python_plugin', 'shared_c'] def build_steps(self): return [['tools/run_tests/build_python.sh']]