grpc-swift 0.9.1 (new formula)

Closes #42323.

Signed-off-by: Chongyu Zhu <i@lembacon.com>
This commit is contained in:
Nora Trapp 2019-07-22 18:57:52 -07:00 committed by Chongyu Zhu
parent 825224b59f
commit 0cf214ae3b
No known key found for this signature in database
GPG key ID: 1A43E3C9100B38F5

36
Formula/grpc-swift.rb Normal file
View file

@ -0,0 +1,36 @@
class GrpcSwift < Formula
desc "The Swift language implementation of gRPC"
homepage "https://github.com/grpc/grpc-swift"
url "https://github.com/grpc/grpc-swift/archive/0.9.1.tar.gz"
sha256 "6b3a2ed13c805c6b8f339f558f2a1372bdcf84c079c104a6d0b54fd7650b8fbf"
head "https://github.com/grpc/grpc-swift.git"
depends_on :xcode => ["10.0", :build]
depends_on "protobuf"
depends_on "swift-protobuf"
def install
system "swift", "build", "--disable-sandbox", "-c", "release", "--product", "protoc-gen-swiftgrpc"
bin.install ".build/release/protoc-gen-swiftgrpc"
end
test do
(testpath/"echo.proto").write <<~EOS
syntax = "proto3";
service Echo {
rpc Get(EchoRequest) returns (EchoResponse) {}
rpc Expand(EchoRequest) returns (stream EchoResponse) {}
rpc Collect(stream EchoRequest) returns (EchoResponse) {}
rpc Update(stream EchoRequest) returns (stream EchoResponse) {}
}
message EchoRequest {
string text = 1;
}
message EchoResponse {
string text = 1;
}
EOS
system Formula["protobuf"].opt_bin/"protoc", "echo.proto", "--swiftgrpc_out=."
assert_predicate testpath/"echo.grpc.swift", :exist?
end
end