aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--examples/objective-c/auth_sample/AuthTestService.podspec26
-rw-r--r--examples/objective-c/auth_sample/Podfile32
-rw-r--r--examples/objective-c/helloworld/HelloWorld.podspec26
-rw-r--r--examples/objective-c/helloworld/Podfile32
-rw-r--r--examples/objective-c/route_guide/Podfile32
-rw-r--r--examples/objective-c/route_guide/RouteGuide.podspec26
-rw-r--r--src/objective-c/!ProtoCompiler-gRPCPlugin.podspec87
-rw-r--r--src/objective-c/!ProtoCompiler.podspec (renamed from src/objective-c/ProtoCompiler.podspec)39
-rw-r--r--src/objective-c/examples/RemoteTestClient/RemoteTest.podspec21
-rw-r--r--src/objective-c/examples/Sample/Podfile3
-rw-r--r--src/objective-c/examples/SwiftSample/Podfile3
-rw-r--r--src/objective-c/tests/Podfile5
-rw-r--r--src/objective-c/tests/RemoteTestClient/RemoteTest.podspec21
-rwxr-xr-xtools/run_tests/run_tests.py2
14 files changed, 239 insertions, 116 deletions
diff --git a/examples/objective-c/auth_sample/AuthTestService.podspec b/examples/objective-c/auth_sample/AuthTestService.podspec
index d246653ea7..b47d5bc7f7 100644
--- a/examples/objective-c/auth_sample/AuthTestService.podspec
+++ b/examples/objective-c/auth_sample/AuthTestService.podspec
@@ -17,23 +17,43 @@ Pod::Spec.new do |s|
dir = "Pods/" + s.name
# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+ s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
+
+ repo_root = '../../..'
+ pods_root = "#{repo_root}/examples/objective-c/auth_sample/Pods"
+
+ protoc_dir = "#{pods_root}/!ProtoCompiler"
+ protoc = "#{protoc_dir}/protoc"
+
+ plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin"
+
s.prepare_command = <<-CMD
mkdir -p #{dir}
- protoc -I #{src} --objc_out=#{dir} --objcgrpc_out=#{dir} #{src}/auth_sample.proto
+ #{protoc} \
+ --plugin=protoc-gen-grpc=#{plugin} \
+ --objc_out=#{dir} \
+ --grpc_out=#{dir} \
+ -I #{src} \
+ -I #{protoc_dir} \
+ #{src}/auth_sample.proto
CMD
s.subspec "Messages" do |ms|
ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}"
ms.header_mappings_dir = dir
ms.requires_arc = false
- ms.dependency "Protobuf", "~> 3.0.0-alpha-4"
+ ms.dependency "Protobuf"
+ # This is needed by all pods that depend on Protobuf:
+ ms.pod_target_xcconfig = {
+ 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
+ }
end
s.subspec "Services" do |ss|
ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}"
ss.header_mappings_dir = dir
ss.requires_arc = true
- ss.dependency "gRPC", "~> 0.12"
+ ss.dependency "gRPC-ProtoRPC"
ss.dependency "#{s.name}/Messages"
end
end
diff --git a/examples/objective-c/auth_sample/Podfile b/examples/objective-c/auth_sample/Podfile
index 32157a9dce..be98cfcbbf 100644
--- a/examples/objective-c/auth_sample/Podfile
+++ b/examples/objective-c/auth_sample/Podfile
@@ -13,34 +13,6 @@ target 'AuthSample' do
# Depend on Google's OAuth2 library
pod 'Google/SignIn'
- # Use the local versions of Protobuf, BoringSSL, and gRPC. You don't need any of the following
- # lines in your application.
- pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
-
- pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
-
- pod 'gRPC', :path => GRPC_LOCAL_SRC
- pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
- pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
- pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC
-end
-
-# This pre_install hook is only needed to use the local version of gRPC-Core. You don't need it in
-# your application.
-pre_install do |installer|
- # This is the gRPC-Core podspec object, as initialized by its podspec file.
- grpc_core_spec = installer.pod_targets.find{|t| t.name == 'gRPC-Core'}.root_spec
-
- # Copied from gRPC-Core.podspec, except for the adjusted src_root:
- src_root = "$(PODS_ROOT)/../#{GRPC_LOCAL_SRC}"
- grpc_core_spec.pod_target_xcconfig = {
- 'GRPC_SRC_ROOT' => src_root,
- 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
- 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
- # If we don't set these two settings, `include/grpc/support/time.h` and
- # `src/core/lib/support/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
- # build.
- 'USE_HEADERMAP' => 'NO',
- 'ALWAYS_SEARCH_USER_PATHS' => 'NO',
- }
+ pod '!ProtoCompiler', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
+ pod '!ProtoCompiler-gRPCPlugin', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
end
diff --git a/examples/objective-c/helloworld/HelloWorld.podspec b/examples/objective-c/helloworld/HelloWorld.podspec
index 17b016b31a..aeb2a8a345 100644
--- a/examples/objective-c/helloworld/HelloWorld.podspec
+++ b/examples/objective-c/helloworld/HelloWorld.podspec
@@ -17,23 +17,43 @@ Pod::Spec.new do |s|
dir = "Pods/" + s.name
# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+ s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
+
+ repo_root = '../../..'
+ pods_root = "#{repo_root}/examples/objective-c/helloworld/Pods"
+
+ protoc_dir = "#{pods_root}/!ProtoCompiler"
+ protoc = "#{protoc_dir}/protoc"
+
+ plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin"
+
s.prepare_command = <<-CMD
mkdir -p #{dir}
- protoc -I #{src} --objc_out=#{dir} --objcgrpc_out=#{dir} #{src}/helloworld.proto
+ #{protoc} \
+ --plugin=protoc-gen-grpc=#{plugin} \
+ --objc_out=#{dir} \
+ --grpc_out=#{dir} \
+ -I #{src} \
+ -I #{protoc_dir} \
+ #{src}/helloworld.proto
CMD
s.subspec "Messages" do |ms|
ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}"
ms.header_mappings_dir = dir
ms.requires_arc = false
- ms.dependency "Protobuf", "~> 3.0.0-alpha-4"
+ ms.dependency "Protobuf"
+ # This is needed by all pods that depend on Protobuf:
+ ms.pod_target_xcconfig = {
+ 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
+ }
end
s.subspec "Services" do |ss|
ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}"
ss.header_mappings_dir = dir
ss.requires_arc = true
- ss.dependency "gRPC", "~> 0.12"
+ ss.dependency "gRPC-ProtoRPC"
ss.dependency "#{s.name}/Messages"
end
end
diff --git a/examples/objective-c/helloworld/Podfile b/examples/objective-c/helloworld/Podfile
index e1bb4ddfd5..2f9de94df5 100644
--- a/examples/objective-c/helloworld/Podfile
+++ b/examples/objective-c/helloworld/Podfile
@@ -10,34 +10,6 @@ target 'HelloWorld' do
# Depend on the generated HelloWorld library.
pod 'HelloWorld', :path => '.'
- # Use the local versions of Protobuf, BoringSSL, and gRPC. You don't need any of the following
- # lines in your application.
- pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
-
- pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
-
- pod 'gRPC', :path => GRPC_LOCAL_SRC
- pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
- pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
- pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC
-end
-
-# This pre_install hook is only needed to use the local version of gRPC-Core. You don't need it in
-# your application.
-pre_install do |installer|
- # This is the gRPC-Core podspec object, as initialized by its podspec file.
- grpc_core_spec = installer.pod_targets.find{|t| t.name == 'gRPC-Core'}.root_spec
-
- # Copied from gRPC-Core.podspec, except for the adjusted src_root:
- src_root = "$(PODS_ROOT)/../#{GRPC_LOCAL_SRC}"
- grpc_core_spec.pod_target_xcconfig = {
- 'GRPC_SRC_ROOT' => src_root,
- 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
- 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
- # If we don't set these two settings, `include/grpc/support/time.h` and
- # `src/core/lib/support/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
- # build.
- 'USE_HEADERMAP' => 'NO',
- 'ALWAYS_SEARCH_USER_PATHS' => 'NO',
- }
+ pod '!ProtoCompiler', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
+ pod '!ProtoCompiler-gRPCPlugin', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
end
diff --git a/examples/objective-c/route_guide/Podfile b/examples/objective-c/route_guide/Podfile
index 943f5464d8..42e6920fa5 100644
--- a/examples/objective-c/route_guide/Podfile
+++ b/examples/objective-c/route_guide/Podfile
@@ -10,34 +10,6 @@ target 'RouteGuideClient' do
# Depend on the generated RouteGuide library.
pod 'RouteGuide', :path => '.'
- # Use the local versions of Protobuf, BoringSSL, and gRPC. You don't need any of the following
- # lines in your application.
- pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
-
- pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
-
- pod 'gRPC', :path => GRPC_LOCAL_SRC
- pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
- pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
- pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC
-end
-
-# This pre_install hook is only needed to use the local version of gRPC-Core. You don't need it in
-# your application.
-pre_install do |installer|
- # This is the gRPC-Core podspec object, as initialized by its podspec file.
- grpc_core_spec = installer.pod_targets.find{|t| t.name == 'gRPC-Core'}.root_spec
-
- # Copied from gRPC-Core.podspec, except for the adjusted src_root:
- src_root = "$(PODS_ROOT)/../#{GRPC_LOCAL_SRC}"
- grpc_core_spec.pod_target_xcconfig = {
- 'GRPC_SRC_ROOT' => src_root,
- 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
- 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
- # If we don't set these two settings, `include/grpc/support/time.h` and
- # `src/core/lib/support/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
- # build.
- 'USE_HEADERMAP' => 'NO',
- 'ALWAYS_SEARCH_USER_PATHS' => 'NO',
- }
+ pod '!ProtoCompiler', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
+ pod '!ProtoCompiler-gRPCPlugin', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
end
diff --git a/examples/objective-c/route_guide/RouteGuide.podspec b/examples/objective-c/route_guide/RouteGuide.podspec
index 97a61ff51a..f7bb55fe9a 100644
--- a/examples/objective-c/route_guide/RouteGuide.podspec
+++ b/examples/objective-c/route_guide/RouteGuide.podspec
@@ -17,23 +17,43 @@ Pod::Spec.new do |s|
dir = "Pods/" + s.name
# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+ s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
+
+ repo_root = '../../..'
+ pods_root = "#{repo_root}/examples/objective-c/route_guide/Pods"
+
+ protoc_dir = "#{pods_root}/!ProtoCompiler"
+ protoc = "#{protoc_dir}/protoc"
+
+ plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin"
+
s.prepare_command = <<-CMD
mkdir -p #{dir}
- protoc -I #{src} --objc_out=#{dir} --objcgrpc_out=#{dir} #{src}/route_guide.proto
+ #{protoc} \
+ --plugin=protoc-gen-grpc=#{plugin} \
+ --objc_out=#{dir} \
+ --grpc_out=#{dir} \
+ -I #{src} \
+ -I #{protoc_dir} \
+ #{src}/route_guide.proto
CMD
s.subspec "Messages" do |ms|
ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}"
ms.header_mappings_dir = dir
ms.requires_arc = false
- ms.dependency "Protobuf", "~> 3.0.0-alpha-4"
+ ms.dependency "Protobuf"
+ # This is needed by all pods that depend on Protobuf:
+ ms.pod_target_xcconfig = {
+ 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
+ }
end
s.subspec "Services" do |ss|
ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}"
ss.header_mappings_dir = dir
ss.requires_arc = true
- ss.dependency "gRPC", "~> 0.12"
+ ss.dependency "gRPC-ProtoRPC"
ss.dependency "#{s.name}/Messages"
end
end
diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec
new file mode 100644
index 0000000000..b2671ec99a
--- /dev/null
+++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec
@@ -0,0 +1,87 @@
+# CocoaPods podspec for the gRPC Proto Compiler Plugin
+
+# Copyright 2016, 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.
+
+Pod::Spec.new do |s|
+ # This pod is only a utility that will be used by other pods _at install time_ (not at compile
+ # time). Other pods can access it in their `prepare_command` script, under <pods_root>/<pod name>.
+ # Because CocoaPods installs pods in alphabetical order, beginning this pod's name with an
+ # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
+ # before them.
+ s.name = '!ProtoCompiler-gRPCPlugin'
+ v = '0.14.0'
+ s.version = v
+ s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.'
+ s.description = <<-DESC
+ This podspec only downloads the gRPC protoc plugin so that local pods generating protos can use
+ it in their invocation of protoc, as part of their prepare_command.
+ The generated code will have a dependency on the gRPC Objective-C Proto runtime of the same
+ version. The runtime can be obtained as the "gRPC-ProtoRPC" pod.
+ DESC
+ s.homepage = 'http://www.grpc.io'
+ s.license = 'New BSD'
+ s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' }
+
+ repo = 'grpc/grpc'
+ release = 'release-0_14_1'
+ file = "grpc_objective_c_plugin-#{v}-macos-x86_64.zip"
+ s.source = {
+ :http => "https://github.com/#{repo}/releases/download/#{release}/#{file}",
+ # TODO(jcanizales): Add sha1 or sha256
+ # :sha1 => '??',
+ }
+
+ repo_root = '../..'
+ plugin = 'grpc_objective_c_plugin'
+
+ s.preserve_paths = plugin
+
+ # Restrict the protoc version to the one supported by this plugin.
+ s.dependency '!ProtoCompiler', '3.0.0-beta-3.1'
+ # Restrict the gRPC runtime version to the one supported by this plugin.
+ s.dependency 'gRPC-ProtoRPC', v
+
+ # This is only for local development of the plugin: If the Podfile brings this pod from a local
+ # directory using `:path`, CocoaPods won't download the zip file and so the plugin won't be
+ # present in this pod's directory. We use that knowledge to check for the existence of the file
+ # and, if absent, compile the plugin from the local sources.
+ s.prepare_command = <<-CMD
+ if [ ! -f #{plugin} ]; then
+ cd #{repo_root}
+ # This will build the plugin and put it in #{repo_root}/bins/opt.
+ #
+ # TODO(jcanizales): I reckon make will try to use locally-installed libprotoc (headers and
+ # library binary) if found, which _we do not want_. Find a way for this to always use the
+ # sources in the repo.
+ make #{plugin}
+ cd -
+ fi
+ CMD
+end
diff --git a/src/objective-c/ProtoCompiler.podspec b/src/objective-c/!ProtoCompiler.podspec
index 2f13853b0b..f78d3c08b0 100644
--- a/src/objective-c/ProtoCompiler.podspec
+++ b/src/objective-c/!ProtoCompiler.podspec
@@ -1,6 +1,6 @@
-# BoringSSL CocoaPods podspec
+# Proto Compiler CocoaPods podspec
-# Copyright 2015, Google Inc.
+# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -30,7 +30,12 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Pod::Spec.new do |s|
- s.name = 'ProtoCompiler'
+ # This pod is only a utility that will be used by other pods _at install time_ (not at compile
+ # time). Other pods can access it in their `prepare_command` script, under <pods_root>/<pod name>.
+ # Because CocoaPods installs pods in alphabetical order, beginning this pod's name with an
+ # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
+ # before them.
+ s.name = '!ProtoCompiler'
v = '3.0.0-beta-3.1'
s.version = v
s.summary = 'The Protobuf Compiler (protoc) generates Objective-C files from .proto files'
@@ -45,12 +50,38 @@ Pod::Spec.new do |s|
# "The name and email addresses of the library maintainers, not the Podspec maintainer."
s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' }
+ repo = 'google/protobuf'
+ release = "v#{v}"
+ file = "protoc-#{v}-osx-x86_64.zip"
s.source = {
- :http => "https://github.com/google/protobuf/releases/download/v#{v}/protoc-#{v}-osx-fat.zip",
+ :http => "https://github.com/#{repo}/releases/download/#{release}/#{file}",
# TODO(jcanizales): Add sha1 or sha256
# :sha1 => '??',
}
s.preserve_paths = 'protoc',
'google/**/*.proto' # Well-known protobuf types
+
+ # Restrict the protobuf runtime version to the one supported by this version of protoc.
+ s.dependency 'Protobuf', v
+
+ # This is only for local development of protoc: If the Podfile brings this pod from a local
+ # directory using `:path`, CocoaPods won't download the zip file and so the compiler won't be
+ # present in this pod's directory. We use that knowledge to check for the existence of the file
+ # and, if absent, build it from the local sources.
+ repo_root = '../..'
+ plugin = 'grpc_objective_c_plugin'
+ s.prepare_command = <<-CMD
+ if [ ! -f protoc ]; then
+ cd #{repo_root}
+ # This will build protoc from the Protobuf submodule of gRPC, and put it in
+ # #{repo_root}/bins/opt/protobuf.
+ #
+ # TODO(jcanizales): Make won't build protoc from sources if one's locally installed, which
+ # _we do not want_. Find a way for this to always build from source.
+ make #{plugin}
+ cd -
+ fi
+ CMD
+
end
diff --git a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec
index e3b50ddea5..6e783fb5ad 100644
--- a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec
+++ b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec
@@ -11,15 +11,30 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.9'
# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+ s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
+
+ repo_root = '../../../..'
+ bin_dir = "#{repo_root}/bins/$CONFIG"
+
+ protoc = "#{bin_dir}/protobuf/protoc"
+ well_known_types_dir = "#{repo_root}/third_party/protobuf/src"
+ plugin = "#{bin_dir}/grpc_objective_c_plugin"
+
s.prepare_command = <<-CMD
- protoc --objc_out=. --objcgrpc_out=. *.proto
+ #{protoc} \
+ --plugin=protoc-gen-grpc=#{plugin} \
+ --objc_out=. \
+ --grpc_out=. \
+ -I . \
+ -I #{well_known_types_dir} \
+ *.proto
CMD
s.subspec 'Messages' do |ms|
ms.source_files = '*.pbobjc.{h,m}'
ms.header_mappings_dir = '.'
ms.requires_arc = false
- ms.dependency 'Protobuf', '~> 3.0.0-beta-3.1'
+ ms.dependency 'Protobuf'
# This is needed by all pods that depend on Protobuf:
ms.pod_target_xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
@@ -30,7 +45,7 @@ Pod::Spec.new do |s|
ss.source_files = '*.pbrpc.{h,m}'
ss.header_mappings_dir = '.'
ss.requires_arc = true
- ss.dependency 'gRPC-ProtoRPC', '~> 0.14'
+ ss.dependency 'gRPC-ProtoRPC'
ss.dependency "#{s.name}/Messages"
end
end
diff --git a/src/objective-c/examples/Sample/Podfile b/src/objective-c/examples/Sample/Podfile
index 80ab2c320d..8740b2f963 100644
--- a/src/objective-c/examples/Sample/Podfile
+++ b/src/objective-c/examples/Sample/Podfile
@@ -12,6 +12,9 @@ target 'Sample' do
# Use the local versions of Protobuf, BoringSSL, and gRPC. You don't need any of the following
# lines in your application.
+ pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+ pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+
pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
diff --git a/src/objective-c/examples/SwiftSample/Podfile b/src/objective-c/examples/SwiftSample/Podfile
index b675fd29ef..2f783340f5 100644
--- a/src/objective-c/examples/SwiftSample/Podfile
+++ b/src/objective-c/examples/SwiftSample/Podfile
@@ -12,6 +12,9 @@ target 'SwiftSample' do
# Use the local versions of Protobuf, BoringSSL, and gRPC. You don't need any of the following
# lines in your application.
+ pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+ pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+
pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
diff --git a/src/objective-c/tests/Podfile b/src/objective-c/tests/Podfile
index 168114da37..8bc23a5169 100644
--- a/src/objective-c/tests/Podfile
+++ b/src/objective-c/tests/Podfile
@@ -17,7 +17,8 @@ GRPC_LOCAL_SRC = '../../..'
).each do |target_name|
target target_name do
pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true
- pod 'ProtoCompiler', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
+ pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+ pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true
pod 'CronetFramework', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
pod 'gRPC', :path => GRPC_LOCAL_SRC
@@ -66,7 +67,7 @@ post_install do |installer|
end
if target.name == 'gRPC-Core'
target.build_configurations.each do |config|
- # TODO(zyc) Remove this setting after the issue is resolved
+ # TODO(zyc): Remove this setting after the issue is resolved
# GPR_UNREACHABLE_CODE causes "Control may reach end of non-void
# function" warning
config.build_settings['GCC_WARN_ABOUT_RETURN_TYPE'] = 'NO'
diff --git a/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec b/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec
index e705310370..7d84a5ae4d 100644
--- a/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec
+++ b/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec
@@ -11,23 +11,30 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.9'
# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+ s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
+
repo_root = '../../../..'
- pods_root = "#{repo_root}/src/objective-c/tests/Pods"
bin_dir = "#{repo_root}/bins/$CONFIG"
- protoc = "#{pods_root}/ProtoCompiler/protoc" # "#{bin_dir}/protobuf/protoc"
+ protoc = "#{bin_dir}/protobuf/protoc"
+ well_known_types_dir = "#{repo_root}/third_party/protobuf/src"
plugin = "#{bin_dir}/grpc_objective_c_plugin"
+
s.prepare_command = <<-CMD
- #{protoc} --plugin=protoc-gen-grpc=#{plugin} --objc_out=. --grpc_out=. *.proto
+ #{protoc} \
+ --plugin=protoc-gen-grpc=#{plugin} \
+ --objc_out=. \
+ --grpc_out=. \
+ -I . \
+ -I #{well_known_types_dir} \
+ *.proto
CMD
- s.dependency "ProtoCompiler", "~> 3.0.0-beta-3.1"
-
s.subspec "Messages" do |ms|
ms.source_files = "*.pbobjc.{h,m}"
ms.header_mappings_dir = "."
ms.requires_arc = false
- ms.dependency "Protobuf", "~> 3.0.0-beta-3.1"
+ ms.dependency "Protobuf"
# This is needed by all pods that depend on Protobuf:
ms.pod_target_xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
@@ -38,7 +45,7 @@ Pod::Spec.new do |s|
ss.source_files = "*.pbrpc.{h,m}"
ss.header_mappings_dir = "."
ss.requires_arc = true
- ss.dependency "gRPC-ProtoRPC", "~> 0.14"
+ ss.dependency "gRPC-ProtoRPC"
ss.dependency "#{s.name}/Messages"
end
end
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index b2cc213f80..ccfbfbe39b 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -634,7 +634,7 @@ class ObjCLanguage(object):
return []
def make_targets(self):
- return ['grpc_objective_c_plugin', 'interop_server']
+ return ['interop_server']
def make_options(self):
return []