Skip to content

Commit

Permalink
Revert "Remove Cocoapods script and references (grpc#1439)"
Browse files Browse the repository at this point in the history
This reverts commit 703d351.
  • Loading branch information
hanckwell committed Jun 29, 2023
1 parent 6cab35e commit f8cc0a7
Show file tree
Hide file tree
Showing 8 changed files with 410 additions and 5 deletions.
20 changes: 20 additions & 0 deletions CGRPCZlib.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Pod::Spec.new do |s|

s.name = 'CGRPCZlib'
s.module_name = 'CGRPCZlib'
s.version = '1.6.0'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.summary = 'Compression library that provides in-memory compression and decompression functions'
s.homepage = 'https://www.grpc.io'
s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' }

s.swift_version = '5.2'
s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '6.0'
s.source = { :git => "https://github.com/grpc/grpc-swift.git", :tag => s.version }

s.source_files = 'Sources/CGRPCZlib/**/*.{swift,c,h}'

end
2 changes: 2 additions & 0 deletions Examples/Google/SpeechToText/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ This project requires a Google Cloud API Key. Please [register](https://cloud.go

## Helpful Links
* [Getting Started with Speech APIs](https://cloud.google.com/speech-to-text/docs/quickstart)
* [CocoaPods](https://cocoapods.org/)
* [gRPC-Swift CocoaPod](https://cocoapods.org/pods/gRPC-Swift)

NOTE: Implementation of the AudioStreamManager is based off of [Google's Example Audio Streaming](https://github.com/GoogleCloudPlatform/ios-docs-samples/blob/master/speech/Swift/Speech-gRPC-Streaming/Speech/AudioController.swift)

35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ insecure channels.
gRPC Swift has recently been rewritten on top of [SwiftNIO][swift-nio] as
opposed to the core library provided by the [gRPC project][grpc].

Version | Implementation | Branch | `protoc` Plugin | Support
--------|----------------|------------------------|-------------------------|-----------------------------------------
1.x | SwiftNIO | [`main`][branch-new] | `protoc-gen-grpc-swift` | Actively developed and supported
0.x | gRPC C library | [`cgrpc`][branch-old] | `protoc-gen-swiftgrpc` | No longer developed; security fixes only
Version | Implementation | Branch | `protoc` Plugin | CocoaPod | Support
--------|----------------|------------------------|-------------------------|-----------------------|-----------------------------------------
1.x | SwiftNIO | [`main`][branch-new] | `protoc-gen-grpc-swift` | [gRPC-Swift][pod-new] | Actively developed and supported
0.x | gRPC C library | [`cgrpc`][branch-old] | `protoc-gen-swiftgrpc` | [SwiftGRPC][pod-old] | No longer developed; security fixes only

The remainder of this README refers to the 1.x version of gRPC Swift.

Expand Down Expand Up @@ -81,6 +81,21 @@ Alternatively, gRPC Swift can be manually integrated into a project:
1. Add the generated project to your own project, and
1. Add a build dependency on `GRPC`.

#### CocoaPods

gRPC Swift is currently available [from CocoaPods][pod-new]. To integrate, add
the following line to your `Podfile`:

```ruby
pod 'gRPC-Swift', '~> 1.0.0'
```

Then, run `pod install` from command line and use your project's generated
`.xcworkspace` file. You might also need to add `use_frameworks!` to your `Podfile`.

*⚠️ If you have conficting modules as a result of having a transitive
dependency on '[gRPC-Core][grpc-core-pod]' see [grpc/grpc-swift#945][grpc-swift-945].*

### Getting the `protoc` Plugins

Binary releases of `protoc`, the Protocol Buffer Compiler, are available on
Expand All @@ -96,6 +111,14 @@ To install these plugins, just copy the two executables (`protoc-gen-swift` and
that is part of your `PATH` environment variable. Alternatively the full path to
the plugins can be specified when using `protoc`.

Alternatively, you can get the latest precompiled version of the plugins by adding
the following line to your `Podfile`:

```ruby
pod 'gRPC-Swift-Plugins'
```
The plugins are available in the `Pods/gRPC-Swift-Plugins/` folder afterwards.

#### Homebrew

The plugins are available from [homebrew](https://brew.sh) and can be installed with:
Expand Down Expand Up @@ -155,11 +178,15 @@ Please get involved! See our [guidelines for contributing](CONTRIBUTING.md).
[docs-tutorial]: ./docs/basic-tutorial.md
[docs-interceptors-tutorial]: ./docs/interceptors-tutorial.md
[grpc]: https://github.com/grpc/grpc
[grpc-core-pod]: https://cocoapods.org/pods/gRPC-Core
[grpc-swift-945]: https://github.com/grpc/grpc-swift/pull/945
[protobuf-releases]: https://github.com/protocolbuffers/protobuf/releases
[swift-nio-platforms]: https://github.com/apple/swift-nio#supported-platforms
[swift-nio]: https://github.com/apple/swift-nio
[swift-protobuf]: https://github.com/apple/swift-protobuf
[xcode-spm]: https://help.apple.com/xcode/mac/current/#/devb83d64851
[pod-new]: https://cocoapods.org/pods/gRPC-Swift
[pod-old]: https://cocoapods.org/pods/SwiftGRPC
[branch-new]: https://github.com/grpc/grpc-swift/tree/main
[branch-old]: https://github.com/grpc/grpc-swift/tree/cgrpc
[examples-out-of-source]: https://github.com/grpc/grpc-swift/tree/main/Examples
Expand Down
4 changes: 3 additions & 1 deletion docs/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ desired, and setting `KeepMethodCasing=true` will yield stubs named `Foo`.
The **GRPCModuleName** option allows the name of the gRPC Swift runtime module
to be specified. The value, if not specified, defaults to "GRPC".

*Note: most users will not need to use this option.*
*Note: most users will not need to use this option. It is intended as a
workaround for CocoaPods users who may end up with a transitive dependency on
the gRPC core C library whose module name is also "GRPC".*

### SwiftProtobufModuleName

Expand Down
20 changes: 20 additions & 0 deletions gRPC-Swift-Plugins.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Pod::Spec.new do |s|

s.name = 'gRPC-Swift-Plugins'
s.version = '1.6.0'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.summary = 'Swift gRPC code generator plugin binaries'
s.homepage = 'https://www.grpc.io'
s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' }

s.swift_version = '5.2'
s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '6.0'
s.source = { :http => "https://github.com/grpc/grpc-swift/releases/download/#{s.version}/protoc-grpc-swift-plugins-#{s.version}.zip"}

s.preserve_paths = '*'
s.dependency 'gRPC-Swift', s.version.to_s

end
29 changes: 29 additions & 0 deletions gRPC-Swift.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Pod::Spec.new do |s|

s.name = 'gRPC-Swift'
s.module_name = 'GRPC'
s.version = '1.6.0'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.summary = 'Swift gRPC code generator plugin and runtime library'
s.homepage = 'https://www.grpc.io'
s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' }

s.swift_version = '5.2'
s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '6.0'
s.source = { :git => "https://github.com/grpc/grpc-swift.git", :tag => s.version }

s.source_files = 'Sources/GRPC/**/*.{swift,c,h}'

s.dependency 'CGRPCZlib', s.version.to_s
s.dependency 'Logging', '>= 1.4.0', '< 2.0.0'
s.dependency 'SwiftNIO', '>= 2.32.0', '< 3.0.0'
s.dependency 'SwiftNIOExtras', '>= 1.4.0', '< 2.0.0'
s.dependency 'SwiftNIOHTTP2', '>= 1.18.2', '< 2.0.0'
s.dependency 'SwiftNIOSSL', '>= 2.14.0', '< 3.0.0'
s.dependency 'SwiftNIOTransportServices', '>= 1.11.1', '< 2.0.0'
s.dependency 'SwiftProtobuf', '>= 1.9.0', '< 2.0.0'

end
Loading

0 comments on commit f8cc0a7

Please sign in to comment.