From f20cfd38442cff30b94e2867436ad4f1ae4e404d Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 24 Jul 2019 21:40:58 -0700 Subject: [PATCH] Build system reorg --- gRPC-ProtoRPC.podspec | 18 ++++++++++++------ gRPC.podspec | 23 ++++++++++++++++------- src/objective-c/ProtoRPC/ProtoRPCLegacy.m | 2 ++ templates/gRPC-ProtoRPC.podspec.template | 18 ++++++++++++------ templates/gRPC.podspec.template | 23 ++++++++++++++++------- 5 files changed, 58 insertions(+), 26 deletions(-) diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 3de3c553567..28ef1d980c6 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -41,13 +41,18 @@ Pod::Spec.new do |s| s.module_name = name s.header_dir = name - src_dir = 'src/objective-c/ProtoRPC' + s.default_subspec = 'Main', 'Legacy', 'Legacy-Header' - s.default_subspec = 'Main', 'Legacy' + s.subspec 'Legacy-Header' do |ss| + ss.header_mappings_dir = "src/objective-c/ProtoRPC" + ss.public_header_files = "src/objective-c/ProtoRPC/ProtoRPCLegacy.h" + ss.source_files = "src/objective-c/ProtoRPC/ProtoRPCLegacy.h" + end s.subspec 'Main' do |ss| - ss.header_mappings_dir = "#{src_dir}" - ss.dependency 'gRPC', version + ss.header_mappings_dir = "src/objective-c/ProtoRPC" + ss.dependency "#{s.name}/Legacy-Header", version + ss.dependency 'gRPC/Interface', version ss.dependency 'Protobuf', '~> 3.0' ss.source_files = "src/objective-c/ProtoRPC/ProtoMethod.{h,m}", @@ -56,13 +61,14 @@ Pod::Spec.new do |s| end s.subspec 'Legacy' do |ss| - ss.header_mappings_dir = "#{src_dir}" + ss.header_mappings_dir = "src/objective-c/ProtoRPC" ss.dependency "#{s.name}/Main", version + ss.dependency "#{s.name}/Legacy-Header", version ss.dependency 'gRPC/GRPCCore', version ss.dependency 'gRPC-RxLibrary', version ss.dependency 'Protobuf', '~> 3.0' - ss.source_files = "src/objective-c/ProtoRPC/ProtoRPCLegacy.{h,m}", + ss.source_files = "src/objective-c/ProtoRPC/ProtoRPCLegacy.m", "src/objective-c/ProtoRPC/ProtoServiceLegacy.{h,m}" end diff --git a/gRPC.podspec b/gRPC.podspec index e4eb63ff4e7..7af8e841d78 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -42,15 +42,20 @@ Pod::Spec.new do |s| s.default_subspec = 'Interface', 'GRPCCore' - # Certificates, to be able to establish TLS connections: - s.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] } - s.pod_target_xcconfig = { # This is needed by all pods that depend on gRPC-RxLibrary: 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', 'CLANG_WARN_STRICT_PROTOTYPES' => 'NO', } + 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.source_files = "src/objective-c/GRPCClient/GRPCCallLegacy.h" + end + s.subspec 'Interface' do |ss| ss.header_mappings_dir = 'src/objective-c/GRPCClient' @@ -75,6 +80,8 @@ Pod::Spec.new do |s| 'src/objective-c/GRPCClient/GRPCTransport.m', 'src/objective-c/GRPCClient/private/GRPCTransport+Private.h', 'src/objective-c/GRPCClient/private/GRPCTransport+Private.m' + + ss.dependency "#{s.name}/Interface-Legacy", version end s.subspec 'GRPCCore' do |ss| @@ -84,7 +91,6 @@ Pod::Spec.new do |s| 'src/objective-c/GRPCClient/GRPCCall+Cronet.h', 'src/objective-c/GRPCClient/GRPCCall+OAuth2.h', 'src/objective-c/GRPCClient/GRPCCall+Tests.h', - 'src/objective-c/GRPCClient/GRPCCallLegacy.h', 'src/objective-c/GRPCClient/GRPCCall+ChannelArg.h', 'src/objective-c/GRPCClient/internal_testing/*.h' ss.private_header_files = 'src/objective-c/GRPCClient/private/GRPCCore/*.h' @@ -100,11 +106,13 @@ Pod::Spec.new do |s| 'src/objective-c/GRPCClient/GRPCCall+OAuth2.m', 'src/objective-c/GRPCClient/GRPCCall+Tests.h', 'src/objective-c/GRPCClient/GRPCCall+Tests.m', - 'src/objective-c/GRPCClient/GRPCCallLegacy.h', 'src/objective-c/GRPCClient/GRPCCallLegacy.m' - ss.dependency 'gRPC-Core', version + # Certificates, to be able to establish TLS connections: + ss.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] } + ss.dependency "#{s.name}/Interface", version + ss.dependency 'gRPC-Core', version ss.dependency 'gRPC-RxLibrary', version end @@ -114,8 +122,9 @@ Pod::Spec.new do |s| ss.source_files = 'src/objective-c/GRPCClient/GRPCCall+Cronet.h', 'src/objective-c/GRPCClient/GRPCCall+Cronet.m', 'src/objective-c/GRPCClient/private/GRPCCore/GRPCCoreCronet/*.{h,m}' - ss.dependency 'CronetFramework' + ss.dependency "#{s.name}/GRPCCore", version ss.dependency 'gRPC-Core/Cronet-Implementation', version + ss.dependency 'CronetFramework' end # CFStream is now default. Leaving this subspec only for compatibility purpose. diff --git a/src/objective-c/ProtoRPC/ProtoRPCLegacy.m b/src/objective-c/ProtoRPC/ProtoRPCLegacy.m index d20da5db840..a4ea1836bdf 100644 --- a/src/objective-c/ProtoRPC/ProtoRPCLegacy.m +++ b/src/objective-c/ProtoRPC/ProtoRPCLegacy.m @@ -1,5 +1,7 @@ #import "ProtoRPCLegacy.h" +#import "ProtoMethod.h" + #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS #import #else diff --git a/templates/gRPC-ProtoRPC.podspec.template b/templates/gRPC-ProtoRPC.podspec.template index 8c0d7ffdb3e..b8a881c06a9 100644 --- a/templates/gRPC-ProtoRPC.podspec.template +++ b/templates/gRPC-ProtoRPC.podspec.template @@ -43,13 +43,18 @@ s.module_name = name s.header_dir = name - src_dir = 'src/objective-c/ProtoRPC' + s.default_subspec = 'Main', 'Legacy', 'Legacy-Header' - s.default_subspec = 'Main', 'Legacy' + s.subspec 'Legacy-Header' do |ss| + ss.header_mappings_dir = "src/objective-c/ProtoRPC" + ss.public_header_files = "src/objective-c/ProtoRPC/ProtoRPCLegacy.h" + ss.source_files = "src/objective-c/ProtoRPC/ProtoRPCLegacy.h" + end s.subspec 'Main' do |ss| - ss.header_mappings_dir = "#{src_dir}" - ss.dependency 'gRPC', version + ss.header_mappings_dir = "src/objective-c/ProtoRPC" + ss.dependency "#{s.name}/Legacy-Header", version + ss.dependency 'gRPC/Interface', version ss.dependency 'Protobuf', '~> 3.0' ss.source_files = "src/objective-c/ProtoRPC/ProtoMethod.{h,m}", @@ -58,13 +63,14 @@ end s.subspec 'Legacy' do |ss| - ss.header_mappings_dir = "#{src_dir}" + ss.header_mappings_dir = "src/objective-c/ProtoRPC" ss.dependency "#{s.name}/Main", version + ss.dependency "#{s.name}/Legacy-Header", version ss.dependency 'gRPC/GRPCCore', version ss.dependency 'gRPC-RxLibrary', version ss.dependency 'Protobuf', '~> 3.0' - ss.source_files = "src/objective-c/ProtoRPC/ProtoRPCLegacy.{h,m}", + ss.source_files = "src/objective-c/ProtoRPC/ProtoRPCLegacy.m", "src/objective-c/ProtoRPC/ProtoServiceLegacy.{h,m}" end diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template index 146da4a323a..59ef8290b6f 100644 --- a/templates/gRPC.podspec.template +++ b/templates/gRPC.podspec.template @@ -44,15 +44,20 @@ s.default_subspec = 'Interface', 'GRPCCore' - # Certificates, to be able to establish TLS connections: - s.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] } - s.pod_target_xcconfig = { # This is needed by all pods that depend on gRPC-RxLibrary: 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', 'CLANG_WARN_STRICT_PROTOTYPES' => 'NO', } + 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.source_files = "src/objective-c/GRPCClient/GRPCCallLegacy.h" + end + s.subspec 'Interface' do |ss| ss.header_mappings_dir = 'src/objective-c/GRPCClient' @@ -77,6 +82,8 @@ 'src/objective-c/GRPCClient/GRPCTransport.m', 'src/objective-c/GRPCClient/private/GRPCTransport+Private.h', 'src/objective-c/GRPCClient/private/GRPCTransport+Private.m' + + ss.dependency "#{s.name}/Interface-Legacy", version end s.subspec 'GRPCCore' do |ss| @@ -86,7 +93,6 @@ 'src/objective-c/GRPCClient/GRPCCall+Cronet.h', 'src/objective-c/GRPCClient/GRPCCall+OAuth2.h', 'src/objective-c/GRPCClient/GRPCCall+Tests.h', - 'src/objective-c/GRPCClient/GRPCCallLegacy.h', 'src/objective-c/GRPCClient/GRPCCall+ChannelArg.h', 'src/objective-c/GRPCClient/internal_testing/*.h' ss.private_header_files = 'src/objective-c/GRPCClient/private/GRPCCore/*.h' @@ -102,11 +108,13 @@ 'src/objective-c/GRPCClient/GRPCCall+OAuth2.m', 'src/objective-c/GRPCClient/GRPCCall+Tests.h', 'src/objective-c/GRPCClient/GRPCCall+Tests.m', - 'src/objective-c/GRPCClient/GRPCCallLegacy.h', 'src/objective-c/GRPCClient/GRPCCallLegacy.m' - ss.dependency 'gRPC-Core', version + # Certificates, to be able to establish TLS connections: + ss.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] } + ss.dependency "#{s.name}/Interface", version + ss.dependency 'gRPC-Core', version ss.dependency 'gRPC-RxLibrary', version end @@ -116,8 +124,9 @@ ss.source_files = 'src/objective-c/GRPCClient/GRPCCall+Cronet.h', 'src/objective-c/GRPCClient/GRPCCall+Cronet.m', 'src/objective-c/GRPCClient/private/GRPCCore/GRPCCoreCronet/*.{h,m}' - ss.dependency 'CronetFramework' + ss.dependency "#{s.name}/GRPCCore", version ss.dependency 'gRPC-Core/Cronet-Implementation', version + ss.dependency 'CronetFramework' end # CFStream is now default. Leaving this subspec only for compatibility purpose.