diff --git a/gRPC.podspec b/gRPC.podspec index 9ddbb18d393..19811a01e1f 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -40,7 +40,7 @@ Pod::Spec.new do |s| s.module_name = name s.header_dir = name - s.default_subspec = 'Interface', 'GRPCCore' + s.default_subspec = 'Interface', 'GRPCCore', 'Interface-Legacy' s.pod_target_xcconfig = { # This is needed by all pods that depend on gRPC-RxLibrary: @@ -51,9 +51,11 @@ Pod::Spec.new do |s| s.subspec 'Interface-Legacy' do |ss| ss.header_mappings_dir = 'src/objective-c/GRPCClient' - ss.public_header_files = "src/objective-c/GRPCClient/GRPCCallLegacy.h" + ss.public_header_files = "src/objective-c/GRPCClient/GRPCCallLegacy.h", + "src/objective-c/GRPCClient/GRPCTypes.h" - ss.source_files = "src/objective-c/GRPCClient/GRPCCallLegacy.h" + ss.source_files = "src/objective-c/GRPCClient/GRPCCallLegacy.h", + "src/objective-c/GRPCClient/GRPCTypes.h" end s.subspec 'Interface' do |ss| @@ -64,8 +66,7 @@ Pod::Spec.new do |s| 'src/objective-c/GRPCClient/GRPCCallOptions.h', 'src/objective-c/GRPCClient/GRPCInterceptor.h', 'src/objective-c/GRPCClient/GRPCTransport.h', - 'src/objective-c/GRPCClient/GRPCDispatchable.h', - 'src/objective-c/GRPCClient/internal/*.h' + 'src/objective-c/GRPCClient/GRPCDispatchable.h' ss.source_files = 'src/objective-c/GRPCClient/GRPCCall.h', 'src/objective-c/GRPCClient/GRPCCall.m', @@ -112,6 +113,7 @@ Pod::Spec.new do |s| # Certificates, to be able to establish TLS connections: ss.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] } + ss.dependency "#{s.name}/Interface-Legacy", version ss.dependency "#{s.name}/Interface", version ss.dependency 'gRPC-Core', version ss.dependency 'gRPC-RxLibrary', version diff --git a/src/objective-c/GRPCClient/GRPCCallLegacy.h b/src/objective-c/GRPCClient/GRPCCallLegacy.h index e6103498639..51dd7da3440 100644 --- a/src/objective-c/GRPCClient/GRPCCallLegacy.h +++ b/src/objective-c/GRPCClient/GRPCCallLegacy.h @@ -22,7 +22,7 @@ */ #import -#import "GRPCCallOptions.h" +#import "GRPCTypes.h" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnullability-completeness" diff --git a/src/objective-c/GRPCClient/GRPCCallOptions.h b/src/objective-c/GRPCClient/GRPCCallOptions.h index 80c0244d78d..6adc8aa1776 100644 --- a/src/objective-c/GRPCClient/GRPCCallOptions.h +++ b/src/objective-c/GRPCClient/GRPCCallOptions.h @@ -18,48 +18,13 @@ #import +#import "GRPCTypes.h" + NS_ASSUME_NONNULL_BEGIN typedef char *GRPCTransportId; @protocol GRPCInterceptorFactory; -/** - * Safety remark of a gRPC method as defined in RFC 2616 Section 9.1 - */ -typedef NS_ENUM(NSUInteger, GRPCCallSafety) { - /** Signal that there is no guarantees on how the call affects the server state. */ - GRPCCallSafetyDefault = 0, - /** Signal that the call is idempotent. gRPC is free to use PUT verb. */ - GRPCCallSafetyIdempotentRequest = 1, - /** - * Signal that the call is cacheable and will not affect server state. gRPC is free to use GET - * verb. - */ - GRPCCallSafetyCacheableRequest = 2, -}; - -// Compression algorithm to be used by a gRPC call -typedef NS_ENUM(NSUInteger, GRPCCompressionAlgorithm) { - GRPCCompressNone = 0, - GRPCCompressDeflate, - GRPCCompressGzip, - GRPCStreamCompressGzip, -}; - -// GRPCCompressAlgorithm is deprecated; use GRPCCompressionAlgorithm -typedef GRPCCompressionAlgorithm GRPCCompressAlgorithm; - -/** The transport to be used by a gRPC call */ -typedef NS_ENUM(NSUInteger, GRPCTransportType) { - GRPCTransportTypeDefault = 0, - /** gRPC internal HTTP/2 stack with BoringSSL */ - GRPCTransportTypeChttp2BoringSSL = 0, - /** Cronet stack */ - GRPCTransportTypeCronet, - /** Insecure channel. FOR TEST ONLY! */ - GRPCTransportTypeInsecure, -}; - /** * Implement this protocol to provide a token to gRPC when a call is initiated. */ diff --git a/src/objective-c/GRPCClient/GRPCTypes.h b/src/objective-c/GRPCClient/GRPCTypes.h new file mode 100644 index 00000000000..45fbe219a91 --- /dev/null +++ b/src/objective-c/GRPCClient/GRPCTypes.h @@ -0,0 +1,37 @@ +/** + * Safety remark of a gRPC method as defined in RFC 2616 Section 9.1 + */ +typedef NS_ENUM(NSUInteger, GRPCCallSafety) { + /** Signal that there is no guarantees on how the call affects the server state. */ + GRPCCallSafetyDefault = 0, + /** Signal that the call is idempotent. gRPC is free to use PUT verb. */ + GRPCCallSafetyIdempotentRequest = 1, + /** + * Signal that the call is cacheable and will not affect server state. gRPC is free to use GET + * verb. + */ + GRPCCallSafetyCacheableRequest = 2, +}; + +// Compression algorithm to be used by a gRPC call +typedef NS_ENUM(NSUInteger, GRPCCompressionAlgorithm) { + GRPCCompressNone = 0, + GRPCCompressDeflate, + GRPCCompressGzip, + GRPCStreamCompressGzip, +}; + +// GRPCCompressAlgorithm is deprecated; use GRPCCompressionAlgorithm +typedef GRPCCompressionAlgorithm GRPCCompressAlgorithm; + +/** The transport to be used by a gRPC call */ +typedef NS_ENUM(NSUInteger, GRPCTransportType) { + GRPCTransportTypeDefault = 0, + /** gRPC internal HTTP/2 stack with BoringSSL */ + GRPCTransportTypeChttp2BoringSSL = 0, + /** Cronet stack */ + GRPCTransportTypeCronet, + /** Insecure channel. FOR TEST ONLY! */ + GRPCTransportTypeInsecure, +}; + diff --git a/src/objective-c/tests/InteropTests/InteropTestsMultipleChannels.m b/src/objective-c/tests/InteropTests/InteropTestsMultipleChannels.m index fef9f2e7ddd..4a3c2b955ac 100644 --- a/src/objective-c/tests/InteropTests/InteropTestsMultipleChannels.m +++ b/src/objective-c/tests/InteropTests/InteropTestsMultipleChannels.m @@ -23,6 +23,7 @@ #import #import #import +#import #import "../ConfigureCronet.h" #import "InteropTestsBlockCallbacks.h" diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template index 21cce3c23ee..78e95abdc9e 100644 --- a/templates/gRPC.podspec.template +++ b/templates/gRPC.podspec.template @@ -42,7 +42,7 @@ s.module_name = name s.header_dir = name - s.default_subspec = 'Interface', 'GRPCCore' + s.default_subspec = 'Interface', 'GRPCCore', 'Interface-Legacy' s.pod_target_xcconfig = { # This is needed by all pods that depend on gRPC-RxLibrary: @@ -53,9 +53,11 @@ s.subspec 'Interface-Legacy' do |ss| ss.header_mappings_dir = 'src/objective-c/GRPCClient' - ss.public_header_files = "src/objective-c/GRPCClient/GRPCCallLegacy.h" + ss.public_header_files = "src/objective-c/GRPCClient/GRPCCallLegacy.h", + "src/objective-c/GRPCClient/GRPCTypes.h" - ss.source_files = "src/objective-c/GRPCClient/GRPCCallLegacy.h" + ss.source_files = "src/objective-c/GRPCClient/GRPCCallLegacy.h", + "src/objective-c/GRPCClient/GRPCTypes.h" end s.subspec 'Interface' do |ss| @@ -66,8 +68,7 @@ 'src/objective-c/GRPCClient/GRPCCallOptions.h', 'src/objective-c/GRPCClient/GRPCInterceptor.h', 'src/objective-c/GRPCClient/GRPCTransport.h', - 'src/objective-c/GRPCClient/GRPCDispatchable.h', - 'src/objective-c/GRPCClient/internal/*.h' + 'src/objective-c/GRPCClient/GRPCDispatchable.h' ss.source_files = 'src/objective-c/GRPCClient/GRPCCall.h', 'src/objective-c/GRPCClient/GRPCCall.m', @@ -114,6 +115,7 @@ # Certificates, to be able to establish TLS connections: ss.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] } + ss.dependency "#{s.name}/Interface-Legacy", version ss.dependency "#{s.name}/Interface", version ss.dependency 'gRPC-Core', version ss.dependency 'gRPC-RxLibrary', version