From 3b309d69cc2eb37f3f78f4dea1b327c8b4a5cb81 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Thu, 4 Jun 2015 12:41:56 -0700 Subject: [PATCH] Generate RemoteTest code on podspec install --- .../RemoteTestClient/Empty.pbobjc.h | 33 - .../RemoteTestClient/Empty.pbobjc.m | 59 -- .../RemoteTestClient/Messages.pbobjc.h | 221 ------- .../RemoteTestClient/Messages.pbobjc.m | 603 ------------------ .../RemoteTestClient/RemoteTest.podspec | 28 +- .../RemoteTestClient/Test.pbobjc.h | 12 - .../RemoteTestClient/Test.pbobjc.m | 9 - .../RemoteTestClient/Test.pbrpc.h | 59 -- .../RemoteTestClient/Test.pbrpc.m | 96 --- 9 files changed, 15 insertions(+), 1105 deletions(-) delete mode 100644 src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.h delete mode 100644 src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.m delete mode 100644 src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.h delete mode 100644 src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.m delete mode 100644 src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.h delete mode 100644 src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.m delete mode 100644 src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.h delete mode 100644 src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.m diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.h b/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.h deleted file mode 100644 index 809d0dde6ee..00000000000 --- a/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.h +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: empty.proto - -#import "GPBProtocolBuffers.h" - -#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000 -#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources. -#endif - -CF_EXTERN_C_BEGIN - -@class RMTEmpty; - - -#pragma mark - RMTEmptyRoot - -@interface RMTEmptyRoot : GPBRootObject -@end - -#pragma mark - RMTEmpty - -// An empty message that you can re-use to avoid defining duplicated empty -// messages in your project. A typical example is to use it as argument or the -// return value of a service API. For instance: -// -// service Foo { -// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { }; -// }; -@interface RMTEmpty : GPBMessage - -@end - -CF_EXTERN_C_END diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.m b/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.m deleted file mode 100644 index 46d481af663..00000000000 --- a/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.m +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: empty.proto - -#import "GPBProtocolBuffers_RuntimeSupport.h" - -#import "Empty.pbobjc.h" - -#pragma mark - RMTEmptyRoot - -@implementation RMTEmptyRoot - -@end - -static GPBFileDescriptor *RMTEmptyRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"grpc.testing" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - RMTEmpty - -@implementation RMTEmpty - - -typedef struct RMTEmpty_Storage { - uint32_t _has_storage_[0]; -} RMTEmpty_Storage; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - }; - descriptor = [GPBDescriptor allocDescriptorForClass:[RMTEmpty class] - rootClass:[RMTEmptyRoot class] - file:RMTEmptyRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(RMTEmpty_Storage) - wireFormat:NO]; - } - return descriptor; -} - -@end - diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.h b/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.h deleted file mode 100644 index 5f323141750..00000000000 --- a/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.h +++ /dev/null @@ -1,221 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: messages.proto - -#import "GPBProtocolBuffers.h" - -#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000 -#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources. -#endif - -CF_EXTERN_C_BEGIN - -@class RMTPayload; -@class RMTResponseParameters; -@class RMTSimpleRequest; -@class RMTSimpleResponse; -@class RMTStreamingInputCallRequest; -@class RMTStreamingInputCallResponse; -@class RMTStreamingOutputCallRequest; -@class RMTStreamingOutputCallResponse; - -#pragma mark - Enum RMTPayloadType - -// The type of payload that should be returned. -typedef GPB_ENUM(RMTPayloadType) { - RMTPayloadType_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - // Compressable text format. - RMTPayloadType_Compressable = 0, - - // Uncompressable binary format. - RMTPayloadType_Uncompressable = 1, - - // Randomly chosen from all other formats defined in this enum. - RMTPayloadType_Random = 2, -}; - -GPBEnumDescriptor *RMTPayloadType_EnumDescriptor(void); - -BOOL RMTPayloadType_IsValidValue(int32_t value); - - -#pragma mark - RMTMessagesRoot - -@interface RMTMessagesRoot : GPBRootObject -@end - -#pragma mark - RMTPayload - -typedef GPB_ENUM(RMTPayload_FieldNumber) { - RMTPayload_FieldNumber_Type = 1, - RMTPayload_FieldNumber_Body = 2, -}; - -// A block of data, to simply increase gRPC message size. -@interface RMTPayload : GPBMessage - -// The type of data in body. -@property(nonatomic, readwrite) RMTPayloadType type; - -// Primary contents of payload. -@property(nonatomic, readwrite, copy) NSData *body; - -@end - -int32_t RMTPayload_Type_RawValue(RMTPayload *message); -void SetRMTPayload_Type_RawValue(RMTPayload *message, int32_t value); - -#pragma mark - RMTSimpleRequest - -typedef GPB_ENUM(RMTSimpleRequest_FieldNumber) { - RMTSimpleRequest_FieldNumber_ResponseType = 1, - RMTSimpleRequest_FieldNumber_ResponseSize = 2, - RMTSimpleRequest_FieldNumber_Payload = 3, - RMTSimpleRequest_FieldNumber_FillUsername = 4, - RMTSimpleRequest_FieldNumber_FillOauthScope = 5, -}; - -// Unary request. -@interface RMTSimpleRequest : GPBMessage - -// Desired payload type in the response from the server. -// If response_type is RANDOM, server randomly chooses one from other formats. -@property(nonatomic, readwrite) RMTPayloadType responseType; - -// Desired payload size in the response from the server. -// If response_type is COMPRESSABLE, this denotes the size before compression. -@property(nonatomic, readwrite) int32_t responseSize; - -// Optional input payload sent along with the request. -@property(nonatomic, readwrite) BOOL hasPayload; -@property(nonatomic, readwrite, strong) RMTPayload *payload; - -// Whether SimpleResponse should include username. -@property(nonatomic, readwrite) BOOL fillUsername; - -// Whether SimpleResponse should include OAuth scope. -@property(nonatomic, readwrite) BOOL fillOauthScope; - -@end - -int32_t RMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message); -void SetRMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message, int32_t value); - -#pragma mark - RMTSimpleResponse - -typedef GPB_ENUM(RMTSimpleResponse_FieldNumber) { - RMTSimpleResponse_FieldNumber_Payload = 1, - RMTSimpleResponse_FieldNumber_Username = 2, - RMTSimpleResponse_FieldNumber_OauthScope = 3, -}; - -// Unary response, as configured by the request. -@interface RMTSimpleResponse : GPBMessage - -// Payload to increase message size. -@property(nonatomic, readwrite) BOOL hasPayload; -@property(nonatomic, readwrite, strong) RMTPayload *payload; - -// The user the request came from, for verifying authentication was -// successful when the client expected it. -@property(nonatomic, readwrite, copy) NSString *username; - -// OAuth scope. -@property(nonatomic, readwrite, copy) NSString *oauthScope; - -@end - -#pragma mark - RMTStreamingInputCallRequest - -typedef GPB_ENUM(RMTStreamingInputCallRequest_FieldNumber) { - RMTStreamingInputCallRequest_FieldNumber_Payload = 1, -}; - -// Client-streaming request. -@interface RMTStreamingInputCallRequest : GPBMessage - -// Optional input payload sent along with the request. -@property(nonatomic, readwrite) BOOL hasPayload; -@property(nonatomic, readwrite, strong) RMTPayload *payload; - -@end - -#pragma mark - RMTStreamingInputCallResponse - -typedef GPB_ENUM(RMTStreamingInputCallResponse_FieldNumber) { - RMTStreamingInputCallResponse_FieldNumber_AggregatedPayloadSize = 1, -}; - -// Client-streaming response. -@interface RMTStreamingInputCallResponse : GPBMessage - -// Aggregated size of payloads received from the client. -@property(nonatomic, readwrite) int32_t aggregatedPayloadSize; - -@end - -#pragma mark - RMTResponseParameters - -typedef GPB_ENUM(RMTResponseParameters_FieldNumber) { - RMTResponseParameters_FieldNumber_Size = 1, - RMTResponseParameters_FieldNumber_IntervalUs = 2, -}; - -// Configuration for a particular response. -@interface RMTResponseParameters : GPBMessage - -// Desired payload sizes in responses from the server. -// If response_type is COMPRESSABLE, this denotes the size before compression. -@property(nonatomic, readwrite) int32_t size; - -// Desired interval between consecutive responses in the response stream in -// microseconds. -@property(nonatomic, readwrite) int32_t intervalUs; - -@end - -#pragma mark - RMTStreamingOutputCallRequest - -typedef GPB_ENUM(RMTStreamingOutputCallRequest_FieldNumber) { - RMTStreamingOutputCallRequest_FieldNumber_ResponseType = 1, - RMTStreamingOutputCallRequest_FieldNumber_ResponseParametersArray = 2, - RMTStreamingOutputCallRequest_FieldNumber_Payload = 3, -}; - -// Server-streaming request. -@interface RMTStreamingOutputCallRequest : GPBMessage - -// 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. -@property(nonatomic, readwrite) RMTPayloadType responseType; - -// Configuration for each expected response message. -// |responseParametersArray| contains |RMTResponseParameters| -@property(nonatomic, readwrite, strong) NSMutableArray *responseParametersArray; - -// Optional input payload sent along with the request. -@property(nonatomic, readwrite) BOOL hasPayload; -@property(nonatomic, readwrite, strong) RMTPayload *payload; - -@end - -int32_t RMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message); -void SetRMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message, int32_t value); - -#pragma mark - RMTStreamingOutputCallResponse - -typedef GPB_ENUM(RMTStreamingOutputCallResponse_FieldNumber) { - RMTStreamingOutputCallResponse_FieldNumber_Payload = 1, -}; - -// Server-streaming response, as configured by the request and parameters. -@interface RMTStreamingOutputCallResponse : GPBMessage - -// Payload to increase response size. -@property(nonatomic, readwrite) BOOL hasPayload; -@property(nonatomic, readwrite, strong) RMTPayload *payload; - -@end - -CF_EXTERN_C_END diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.m b/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.m deleted file mode 100644 index 98eb1dc87c8..00000000000 --- a/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.m +++ /dev/null @@ -1,603 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: messages.proto - -#import "GPBProtocolBuffers_RuntimeSupport.h" - -#import "Messages.pbobjc.h" - -#pragma mark - RMTMessagesRoot - -@implementation RMTMessagesRoot - -@end - -static GPBFileDescriptor *RMTMessagesRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"grpc.testing" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - Enum RMTPayloadType - -GPBEnumDescriptor *RMTPayloadType_EnumDescriptor(void) { - static GPBEnumDescriptor *descriptor = NULL; - if (!descriptor) { - static GPBMessageEnumValueDescription values[] = { - { .name = "Compressable", .number = RMTPayloadType_Compressable }, - { .name = "Uncompressable", .number = RMTPayloadType_Uncompressable }, - { .name = "Random", .number = RMTPayloadType_Random }, - }; - descriptor = [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(RMTPayloadType) - values:values - valueCount:sizeof(values) / sizeof(GPBMessageEnumValueDescription) - enumVerifier:RMTPayloadType_IsValidValue]; - } - return descriptor; -} - -BOOL RMTPayloadType_IsValidValue(int32_t value__) { - switch (value__) { - case RMTPayloadType_Compressable: - case RMTPayloadType_Uncompressable: - case RMTPayloadType_Random: - return YES; - default: - return NO; - } -} - -#pragma mark - RMTPayload - -@implementation RMTPayload - -@dynamic type; -@dynamic body; - -typedef struct RMTPayload_Storage { - uint32_t _has_storage_[1]; - RMTPayloadType type; - NSData *body; -} RMTPayload_Storage; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "type", - .number = RMTPayload_FieldNumber_Type, - .hasIndex = 0, - .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor, - .type = GPBTypeEnum, - .offset = offsetof(RMTPayload_Storage, type), - .defaultValue.valueEnum = RMTPayloadType_Compressable, - .typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor, - .fieldOptions = NULL, - }, - { - .name = "body", - .number = RMTPayload_FieldNumber_Body, - .hasIndex = 1, - .flags = GPBFieldOptional, - .type = GPBTypeData, - .offset = offsetof(RMTPayload_Storage, body), - .defaultValue.valueData = nil, - .typeSpecific.className = NULL, - .fieldOptions = NULL, - }, - }; - descriptor = [GPBDescriptor allocDescriptorForClass:[RMTPayload class] - rootClass:[RMTMessagesRoot class] - file:RMTMessagesRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(RMTPayload_Storage) - wireFormat:NO]; - } - return descriptor; -} - -@end - -int32_t RMTPayload_Type_RawValue(RMTPayload *message) { - GPBDescriptor *descriptor = [RMTPayload descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTPayload_FieldNumber_Type]; - return GPBGetInt32IvarWithField(message, field); -} - -void SetRMTPayload_Type_RawValue(RMTPayload *message, int32_t value) { - GPBDescriptor *descriptor = [RMTPayload descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTPayload_FieldNumber_Type]; - GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); -} - -#pragma mark - RMTSimpleRequest - -@implementation RMTSimpleRequest - -@dynamic responseType; -@dynamic responseSize; -@dynamic hasPayload, payload; -@dynamic fillUsername; -@dynamic fillOauthScope; - -typedef struct RMTSimpleRequest_Storage { - uint32_t _has_storage_[1]; - BOOL fillUsername; - BOOL fillOauthScope; - RMTPayloadType responseType; - int32_t responseSize; - RMTPayload *payload; -} RMTSimpleRequest_Storage; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "responseType", - .number = RMTSimpleRequest_FieldNumber_ResponseType, - .hasIndex = 0, - .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor, - .type = GPBTypeEnum, - .offset = offsetof(RMTSimpleRequest_Storage, responseType), - .defaultValue.valueEnum = RMTPayloadType_Compressable, - .typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor, - .fieldOptions = NULL, - }, - { - .name = "responseSize", - .number = RMTSimpleRequest_FieldNumber_ResponseSize, - .hasIndex = 1, - .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(RMTSimpleRequest_Storage, responseSize), - .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, - .fieldOptions = NULL, - }, - { - .name = "payload", - .number = RMTSimpleRequest_FieldNumber_Payload, - .hasIndex = 2, - .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(RMTSimpleRequest_Storage, payload), - .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(RMTPayload), - .fieldOptions = NULL, - }, - { - .name = "fillUsername", - .number = RMTSimpleRequest_FieldNumber_FillUsername, - .hasIndex = 3, - .flags = GPBFieldOptional, - .type = GPBTypeBool, - .offset = offsetof(RMTSimpleRequest_Storage, fillUsername), - .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, - .fieldOptions = NULL, - }, - { - .name = "fillOauthScope", - .number = RMTSimpleRequest_FieldNumber_FillOauthScope, - .hasIndex = 4, - .flags = GPBFieldOptional, - .type = GPBTypeBool, - .offset = offsetof(RMTSimpleRequest_Storage, fillOauthScope), - .defaultValue.valueBool = NO, - .typeSpecific.className = NULL, - .fieldOptions = NULL, - }, - }; - descriptor = [GPBDescriptor allocDescriptorForClass:[RMTSimpleRequest class] - rootClass:[RMTMessagesRoot class] - file:RMTMessagesRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(RMTSimpleRequest_Storage) - wireFormat:NO]; - } - return descriptor; -} - -@end - -int32_t RMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message) { - GPBDescriptor *descriptor = [RMTSimpleRequest descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTSimpleRequest_FieldNumber_ResponseType]; - return GPBGetInt32IvarWithField(message, field); -} - -void SetRMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message, int32_t value) { - GPBDescriptor *descriptor = [RMTSimpleRequest descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTSimpleRequest_FieldNumber_ResponseType]; - GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); -} - -#pragma mark - RMTSimpleResponse - -@implementation RMTSimpleResponse - -@dynamic hasPayload, payload; -@dynamic username; -@dynamic oauthScope; - -typedef struct RMTSimpleResponse_Storage { - uint32_t _has_storage_[1]; - RMTPayload *payload; - NSString *username; - NSString *oauthScope; -} RMTSimpleResponse_Storage; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "payload", - .number = RMTSimpleResponse_FieldNumber_Payload, - .hasIndex = 0, - .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(RMTSimpleResponse_Storage, payload), - .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(RMTPayload), - .fieldOptions = NULL, - }, - { - .name = "username", - .number = RMTSimpleResponse_FieldNumber_Username, - .hasIndex = 1, - .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(RMTSimpleResponse_Storage, username), - .defaultValue.valueString = nil, - .typeSpecific.className = NULL, - .fieldOptions = NULL, - }, - { - .name = "oauthScope", - .number = RMTSimpleResponse_FieldNumber_OauthScope, - .hasIndex = 2, - .flags = GPBFieldOptional, - .type = GPBTypeString, - .offset = offsetof(RMTSimpleResponse_Storage, oauthScope), - .defaultValue.valueString = nil, - .typeSpecific.className = NULL, - .fieldOptions = NULL, - }, - }; - descriptor = [GPBDescriptor allocDescriptorForClass:[RMTSimpleResponse class] - rootClass:[RMTMessagesRoot class] - file:RMTMessagesRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(RMTSimpleResponse_Storage) - wireFormat:NO]; - } - return descriptor; -} - -@end - -#pragma mark - RMTStreamingInputCallRequest - -@implementation RMTStreamingInputCallRequest - -@dynamic hasPayload, payload; - -typedef struct RMTStreamingInputCallRequest_Storage { - uint32_t _has_storage_[1]; - RMTPayload *payload; -} RMTStreamingInputCallRequest_Storage; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "payload", - .number = RMTStreamingInputCallRequest_FieldNumber_Payload, - .hasIndex = 0, - .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(RMTStreamingInputCallRequest_Storage, payload), - .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(RMTPayload), - .fieldOptions = NULL, - }, - }; - descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingInputCallRequest class] - rootClass:[RMTMessagesRoot class] - file:RMTMessagesRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(RMTStreamingInputCallRequest_Storage) - wireFormat:NO]; - } - return descriptor; -} - -@end - -#pragma mark - RMTStreamingInputCallResponse - -@implementation RMTStreamingInputCallResponse - -@dynamic aggregatedPayloadSize; - -typedef struct RMTStreamingInputCallResponse_Storage { - uint32_t _has_storage_[1]; - int32_t aggregatedPayloadSize; -} RMTStreamingInputCallResponse_Storage; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "aggregatedPayloadSize", - .number = RMTStreamingInputCallResponse_FieldNumber_AggregatedPayloadSize, - .hasIndex = 0, - .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(RMTStreamingInputCallResponse_Storage, aggregatedPayloadSize), - .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, - .fieldOptions = NULL, - }, - }; - descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingInputCallResponse class] - rootClass:[RMTMessagesRoot class] - file:RMTMessagesRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(RMTStreamingInputCallResponse_Storage) - wireFormat:NO]; - } - return descriptor; -} - -@end - -#pragma mark - RMTResponseParameters - -@implementation RMTResponseParameters - -@dynamic size; -@dynamic intervalUs; - -typedef struct RMTResponseParameters_Storage { - uint32_t _has_storage_[1]; - int32_t size; - int32_t intervalUs; -} RMTResponseParameters_Storage; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "size", - .number = RMTResponseParameters_FieldNumber_Size, - .hasIndex = 0, - .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(RMTResponseParameters_Storage, size), - .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, - .fieldOptions = NULL, - }, - { - .name = "intervalUs", - .number = RMTResponseParameters_FieldNumber_IntervalUs, - .hasIndex = 1, - .flags = GPBFieldOptional, - .type = GPBTypeInt32, - .offset = offsetof(RMTResponseParameters_Storage, intervalUs), - .defaultValue.valueInt32 = 0, - .typeSpecific.className = NULL, - .fieldOptions = NULL, - }, - }; - descriptor = [GPBDescriptor allocDescriptorForClass:[RMTResponseParameters class] - rootClass:[RMTMessagesRoot class] - file:RMTMessagesRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(RMTResponseParameters_Storage) - wireFormat:NO]; - } - return descriptor; -} - -@end - -#pragma mark - RMTStreamingOutputCallRequest - -@implementation RMTStreamingOutputCallRequest - -@dynamic responseType; -@dynamic responseParametersArray; -@dynamic hasPayload, payload; - -typedef struct RMTStreamingOutputCallRequest_Storage { - uint32_t _has_storage_[1]; - RMTPayloadType responseType; - NSMutableArray *responseParametersArray; - RMTPayload *payload; -} RMTStreamingOutputCallRequest_Storage; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "responseType", - .number = RMTStreamingOutputCallRequest_FieldNumber_ResponseType, - .hasIndex = 0, - .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor, - .type = GPBTypeEnum, - .offset = offsetof(RMTStreamingOutputCallRequest_Storage, responseType), - .defaultValue.valueEnum = RMTPayloadType_Compressable, - .typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor, - .fieldOptions = NULL, - }, - { - .name = "responseParametersArray", - .number = RMTStreamingOutputCallRequest_FieldNumber_ResponseParametersArray, - .hasIndex = GPBNoHasBit, - .flags = GPBFieldRepeated, - .type = GPBTypeMessage, - .offset = offsetof(RMTStreamingOutputCallRequest_Storage, responseParametersArray), - .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(RMTResponseParameters), - .fieldOptions = NULL, - }, - { - .name = "payload", - .number = RMTStreamingOutputCallRequest_FieldNumber_Payload, - .hasIndex = 2, - .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(RMTStreamingOutputCallRequest_Storage, payload), - .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(RMTPayload), - .fieldOptions = NULL, - }, - }; - descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingOutputCallRequest class] - rootClass:[RMTMessagesRoot class] - file:RMTMessagesRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(RMTStreamingOutputCallRequest_Storage) - wireFormat:NO]; - } - return descriptor; -} - -@end - -int32_t RMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message) { - GPBDescriptor *descriptor = [RMTStreamingOutputCallRequest descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTStreamingOutputCallRequest_FieldNumber_ResponseType]; - return GPBGetInt32IvarWithField(message, field); -} - -void SetRMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message, int32_t value) { - GPBDescriptor *descriptor = [RMTStreamingOutputCallRequest descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTStreamingOutputCallRequest_FieldNumber_ResponseType]; - GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); -} - -#pragma mark - RMTStreamingOutputCallResponse - -@implementation RMTStreamingOutputCallResponse - -@dynamic hasPayload, payload; - -typedef struct RMTStreamingOutputCallResponse_Storage { - uint32_t _has_storage_[1]; - RMTPayload *payload; -} RMTStreamingOutputCallResponse_Storage; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = NULL; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "payload", - .number = RMTStreamingOutputCallResponse_FieldNumber_Payload, - .hasIndex = 0, - .flags = GPBFieldOptional, - .type = GPBTypeMessage, - .offset = offsetof(RMTStreamingOutputCallResponse_Storage, payload), - .defaultValue.valueMessage = nil, - .typeSpecific.className = GPBStringifySymbol(RMTPayload), - .fieldOptions = NULL, - }, - }; - descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingOutputCallResponse class] - rootClass:[RMTMessagesRoot class] - file:RMTMessagesRoot_FileDescriptor() - fields:fields - fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription) - oneofs:NULL - oneofCount:0 - enums:NULL - enumCount:0 - ranges:NULL - rangeCount:0 - storageSize:sizeof(RMTStreamingOutputCallResponse_Storage) - wireFormat:NO]; - } - return descriptor; -} - -@end - diff --git a/src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec b/src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec index c8ac0846504..db497323fff 100644 --- a/src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec +++ b/src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec @@ -1,22 +1,24 @@ Pod::Spec.new do |s| - s.name = 'RemoteTest' - s.version = '0.0.1' - s.summary = 'Protobuf library generated from test.proto, messages.proto, and empty.proto' - s.license = 'New BSD' + s.name = "RemoteTest" + s.version = "0.0.1" + s.license = "New BSD" - s.ios.deployment_target = '6.0' - s.osx.deployment_target = '10.8' + s.ios.deployment_target = "6.0" + s.osx.deployment_target = "10.8" - s.subspec 'Messages' do |ms| - ms.source_files = '*.pbobjc.{h,m}' + # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. + s.prepare_command = "protoc --objc_out=. --objcgrpc_out=. *.proto" + + s.subspec "Messages" do |ms| + ms.source_files = "*.pbobjc.{h,m}" ms.requires_arc = false - ms.dependency 'Protobuf', '~> 3.0.0-alpha-3' + ms.dependency "Protobuf", "~> 3.0.0-alpha-3" end - s.subspec 'Services' do |ss| - ss.source_files = '*.pbrpc.{h,m}' + s.subspec "Services" do |ss| + ss.source_files = "*.pbrpc.{h,m}" ss.requires_arc = true - ss.dependency 'gRPC', '~> 0.5' - ss.dependency 'RemoteTest/Messages' + ss.dependency "gRPC", "~> 0.5" + ss.dependency "#{s.name}/Messages" end end diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.h b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.h deleted file mode 100644 index aaa0b6ce2db..00000000000 --- a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.h +++ /dev/null @@ -1,12 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: test.proto - -#import "GPBProtocolBuffers.h" - -#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000 -#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources. -#endif - -CF_EXTERN_C_BEGIN - -CF_EXTERN_C_END diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.m b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.m deleted file mode 100644 index 08562b828a4..00000000000 --- a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.m +++ /dev/null @@ -1,9 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: test.proto - -// File empty because all messages, extensions and enum have been filtered. - - -// Dummy symbol that will be stripped but will avoid linker warnings about -// no symbols in the .o form compiling this file. -static int RMTTestRoot_dummy __attribute__((unused,used)) = 0; diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.h b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.h deleted file mode 100644 index f799c4fc92f..00000000000 --- a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.h +++ /dev/null @@ -1,59 +0,0 @@ -#import "Test.pbobjc.h" -#import - -#import "Empty.pbobjc.h" -#import "Messages.pbobjc.h" - -@protocol GRXWriteable; -@protocol GRXWriter; - -@protocol RMTTestService - -#pragma mark EmptyCall(Empty) returns (Empty) - -- (void)emptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler; - -- (ProtoRPC *)RPCToEmptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler; - - -#pragma mark UnaryCall(SimpleRequest) returns (SimpleResponse) - -- (void)unaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler; - -- (ProtoRPC *)RPCToUnaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler; - - -#pragma mark StreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -- (void)streamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - -- (ProtoRPC *)RPCToStreamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - - -#pragma mark StreamingInputCall(stream StreamingInputCallRequest) returns (StreamingInputCallResponse) - -- (void)streamingInputCallWithRequestsWriter:(id)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler; - -- (ProtoRPC *)RPCToStreamingInputCallWithRequestsWriter:(id)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler; - - -#pragma mark FullDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -- (void)fullDuplexCallWithRequestsWriter:(id)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - -- (ProtoRPC *)RPCToFullDuplexCallWithRequestsWriter:(id)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - - -#pragma mark HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -- (void)halfDuplexCallWithRequestsWriter:(id)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - -- (ProtoRPC *)RPCToHalfDuplexCallWithRequestsWriter:(id)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler; - - -@end - -// Basic service implementation, over gRPC, that only does marshalling and parsing. -@interface RMTTestService : ProtoService -- (instancetype)initWithHost:(NSString *)host NS_DESIGNATED_INITIALIZER; -@end diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.m b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.m deleted file mode 100644 index faba07769e5..00000000000 --- a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.m +++ /dev/null @@ -1,96 +0,0 @@ -#import "Test.pbrpc.h" -#import -#import -#import - -static NSString *const kPackageName = @"grpc.testing"; -static NSString *const kServiceName = @"TestService"; - -@implementation RMTTestService - -// Designated initializer -- (instancetype)initWithHost:(NSString *)host { - return (self = [super initWithHost:host packageName:kPackageName serviceName:kServiceName]); -} - -// Override superclass initializer to disallow different package and service names. -- (instancetype)initWithHost:(NSString *)host - packageName:(NSString *)packageName - serviceName:(NSString *)serviceName { - return [self initWithHost:host]; -} - - -#pragma mark EmptyCall(Empty) returns (Empty) - -- (void)emptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler{ - [[self RPCToEmptyCallWithRequest:request handler:handler] start]; -} -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToEmptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler{ - return [self RPCToMethod:@"EmptyCall" - requestsWriter:[GRXWriter writerWithValue:request] - responseClass:[RMTEmpty class] - responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]]; -} -#pragma mark UnaryCall(SimpleRequest) returns (SimpleResponse) - -- (void)unaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler{ - [[self RPCToUnaryCallWithRequest:request handler:handler] start]; -} -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToUnaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler{ - return [self RPCToMethod:@"UnaryCall" - requestsWriter:[GRXWriter writerWithValue:request] - responseClass:[RMTSimpleResponse class] - responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]]; -} -#pragma mark StreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -- (void)streamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ - [[self RPCToStreamingOutputCallWithRequest:request handler:handler] start]; -} -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToStreamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ - return [self RPCToMethod:@"StreamingOutputCall" - requestsWriter:[GRXWriter writerWithValue:request] - responseClass:[RMTStreamingOutputCallResponse class] - responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]]; -} -#pragma mark StreamingInputCall(stream StreamingInputCallRequest) returns (StreamingInputCallResponse) - -- (void)streamingInputCallWithRequestsWriter:(id)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler{ - [[self RPCToStreamingInputCallWithRequestsWriter:request handler:handler] start]; -} -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToStreamingInputCallWithRequestsWriter:(id)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler{ - return [self RPCToMethod:@"StreamingInputCall" - requestsWriter:request - responseClass:[RMTStreamingInputCallResponse class] - responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]]; -} -#pragma mark FullDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -- (void)fullDuplexCallWithRequestsWriter:(id)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ - [[self RPCToFullDuplexCallWithRequestsWriter:request handler:handler] start]; -} -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToFullDuplexCallWithRequestsWriter:(id)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ - return [self RPCToMethod:@"FullDuplexCall" - requestsWriter:request - responseClass:[RMTStreamingOutputCallResponse class] - responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]]; -} -#pragma mark HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse) - -- (void)halfDuplexCallWithRequestsWriter:(id)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ - [[self RPCToHalfDuplexCallWithRequestsWriter:request handler:handler] start]; -} -// Returns a not-yet-started RPC object. -- (ProtoRPC *)RPCToHalfDuplexCallWithRequestsWriter:(id)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{ - return [self RPCToMethod:@"HalfDuplexCall" - requestsWriter:request - responseClass:[RMTStreamingOutputCallResponse class] - responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]]; -} -@end