grpc-swift 0.9.1 (new formula)
Closes #42323. Signed-off-by: Chongyu Zhu <i@lembacon.com>
This commit is contained in:
parent
825224b59f
commit
0cf214ae3b
1 changed files with 36 additions and 0 deletions
36
Formula/grpc-swift.rb
Normal file
36
Formula/grpc-swift.rb
Normal 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
|
Loading…
Reference in a new issue