Imported Upstream version 1.34.0
[platform/upstream/grpc.git] / templates / src / objective-c / !ProtoCompiler-gRPCCppPlugin.podspec.template
1 %YAML 1.2
2 --- |
3   # This file has been automatically generated from a template file.
4   # Please make modifications to
5   # `templates/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec.template`
6   # instead. This file can be regenerated from the template by running
7   # `tools/buildgen/generate_projects.sh`.
8
9   # CocoaPods podspec for the gRPC Proto Compiler Plugin
10   #
11   # Copyright 2019, Google Inc.
12   # All rights reserved.
13   #
14   # Redistribution and use in source and binary forms, with or without
15   # modification, are permitted provided that the following conditions are
16   # met:
17   #
18   #     * Redistributions of source code must retain the above copyright
19   # notice, this list of conditions and the following disclaimer.
20   #     * Redistributions in binary form must reproduce the above
21   # copyright notice, this list of conditions and the following disclaimer
22   # in the documentation and/or other materials provided with the
23   # distribution.
24   #     * Neither the name of Google Inc. nor the names of its
25   # contributors may be used to endorse or promote products derived from
26   # this software without specific prior written permission.
27   #
28   # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29   # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30   # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31   # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32   # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33   # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34   # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35   # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36   # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37   # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38   # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
40   Pod::Spec.new do |s|
41     # This pod is only a utility that will be used by other pods _at install time_ (not at compile
42     # time). Other pods can access it in their `prepare_command` script, under <pods_root>/<pod name>.
43     # Because CocoaPods installs pods in alphabetical order, beginning this pod's name with an
44     # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
45     # before them.
46     s.name     = '!ProtoCompiler-gRPCCppPlugin'
47     v = '${settings.version}'
48     s.version  = v
49     s.summary  = 'The gRPC ProtoC plugin generates C++ files from .proto services.'
50     s.description = <<-DESC
51       This podspec only downloads the gRPC protoc plugin so that local pods generating protos can use
52       it in their invocation of protoc, as part of their prepare_command.
53     DESC
54     s.homepage = 'https://grpc.io'
55     s.license  = {
56       :type => 'Apache License, Version 2.0',
57       :text => <<-LICENSE
58         Copyright 2019, Google Inc.
59         All rights reserved.
60
61         Redistribution and use in source and binary forms, with or without
62         modification, are permitted provided that the following conditions are
63         met:
64
65             * Redistributions of source code must retain the above copyright
66         notice, this list of conditions and the following disclaimer.
67             * Redistributions in binary form must reproduce the above
68         copyright notice, this list of conditions and the following disclaimer
69         in the documentation and/or other materials provided with the
70         distribution.
71             * Neither the name of Google Inc. nor the names of its
72         contributors may be used to endorse or promote products derived from
73         this software without specific prior written permission.
74
75         THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
76         "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
77         LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
78         A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
79         OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
80         SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
81         LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
82         DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
83         THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
84         (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
85         OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
86       LICENSE
87     }
88     s.authors  = { 'The gRPC contributors' => 'grpc-packages@google.com' }
89
90     repo = 'grpc/grpc'
91     file = "grpc_cpp_plugin-#{v}-macos-x86_64.zip"
92     s.source = {
93       :http => "https://github.com/#{repo}/releases/download/v#{v}/#{file}",
94       # TODO(jcanizales): Add sha1 or sha256
95       # :sha1 => '??',
96     }
97
98     repo_root = '../..'
99     bazel = "#{repo_root}/tools/bazel"
100     plugin = 'grpc_cpp_plugin'
101
102     s.preserve_paths = plugin
103
104     # Restrict the protoc version to the one supported by this plugin.
105     s.dependency '!ProtoCompiler', '3.13.0'
106     # For the Protobuf dependency not to complain:
107     s.ios.deployment_target = '9.0'
108     s.osx.deployment_target = '10.10'
109     s.tvos.deployment_target = '10.0'
110     s.watchos.deployment_target = '2.0'
111
112     # This is only for local development of the plugin: If the Podfile brings this pod from a local
113     # directory using `:path`, CocoaPods won't download the zip file and so the plugin won't be
114     # present in this pod's directory. We use that knowledge to check for the existence of the file
115     # and, if absent, compile the plugin from the local sources.
116     s.prepare_command = <<-CMD
117       #{bazel} build //src/compiler:grpc_cpp_plugin
118     CMD
119   end