aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/gRPC.podspec.template
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2015-06-23 17:31:25 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2015-06-23 17:31:25 -0700
commit870af21d65b6b21bb2dd6127797eee86c1aef727 (patch)
treeb6178c5d6fec0d253d12e10e0256d19e6d22490a /templates/gRPC.podspec.template
parentbe79da21c5fab8cfc34c594ff27a28975b565eab (diff)
parentdf3557738ca5eb071e05c6673e6ebab55a2e7fc7 (diff)
Merge pull request #2172 from murgatroid99/podspec_remove_include_paths
Move /include/... up on pod install, to put it on a search path Cocoapods supports
Diffstat (limited to 'templates/gRPC.podspec.template')
-rw-r--r--templates/gRPC.podspec.template25
1 files changed, 9 insertions, 16 deletions
diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template
index 03c303b414..f59b6a9ab1 100644
--- a/templates/gRPC.podspec.template
+++ b/templates/gRPC.podspec.template
@@ -38,9 +38,10 @@ bad_header_names = ('time.h', 'string.h')
def fix_header_name(name):
split_name = name.split('/')
if split_name[-1] in bad_header_names:
- return '/'.join(split_name[:-1] + ['grpc_' + split_name[-1]])
- else:
- return name
+ split_name[-1] = 'grpc_' + split_name[-1]
+ if split_name[0] == 'include':
+ split_name = split_name[1:]
+ return '/'.join(split_name)
%>
Pod::Spec.new do |s|
@@ -93,14 +94,6 @@ Pod::Spec.new do |s|
% endfor
cs.header_mappings_dir = '.'
- # The core library includes its headers as either "src/core/..." or "grpc/...", meaning we have
- # to tell XCode to look for headers under the "include" subdirectory too.
- #
- # TODO(jcanizales): Instead of doing this, during installation move everything under
- # "include/grpc" one directory up. The directory names under PODS_ROOT are implementation
- # details of Cocoapods, and have changed in the past, breaking this podspec.
- cs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Private/gRPC" ' +
- '"$(PODS_ROOT)/Headers/Private/gRPC/include"' }
cs.requires_arc = false
cs.libraries = 'z'
@@ -114,10 +107,13 @@ Pod::Spec.new do |s|
#
# TODO(jcanizales): Try out Todd Reed's solution at Issue #1437.
s.prepare_command = <<-CMD
+ # Move contents of include up a level to avoid manually specifying include paths
+ cp -r "include/grpc" "."
+
DIR_TIME="grpc/support"
BAD_TIME="$DIR_TIME/time.h"
GOOD_TIME="$DIR_TIME/grpc_time.h"
- grep -rl "$BAD_TIME" include/grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
+ grep -rl "$BAD_TIME" grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
if [ -f "include/$BAD_TIME" ];
then
mv -f "include/$BAD_TIME" "include/$GOOD_TIME"
@@ -126,7 +122,7 @@ Pod::Spec.new do |s|
DIR_STRING="src/core/support"
BAD_STRING="$DIR_STRING/string.h"
GOOD_STRING="$DIR_STRING/grpc_string.h"
- grep -rl "$BAD_STRING" include/grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
+ grep -rl "$BAD_STRING" grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
if [ -f "$BAD_STRING" ];
then
mv -f "$BAD_STRING" "$GOOD_STRING"
@@ -141,9 +137,6 @@ Pod::Spec.new do |s|
gs.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
gs.dependency 'gRPC/C-Core'
- # TODO(jcanizales): Remove this when the prepare_command moves everything under "include/grpc"
- # one directory up.
- gs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Public/gRPC/include"' }
gs.dependency 'gRPC/RxLibrary'
# Certificates, to be able to establish TLS connections: