Add swift grpc code-gen and use latest grpcSwift pod

This commit is contained in:
Piv
2020-04-28 23:00:31 +09:30
parent b633fdea95
commit a3a163b654
5 changed files with 21 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ target 'CarController' do
use_frameworks!
# Pods for CarController
pod 'SwiftGRPC'
pod 'gRPC-Swift', '1.0.0-alpha.11'
pod 'SwiftyZeroMQ5'
pod 'SwiftProtobuf', '~> 1.0'
end

View File

View File

@@ -12,17 +12,28 @@ configurations {
canBeResolved = false
canBeConsumed = true
}
// For Swift Codegen
swift {
canBeConsumed = true
canBeResolved = false
}
}
protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.11.0' }
plugins {
swift {
path = "$projectDir/grpc_plugins/protoc-gen-swift"
}
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.28.1' // CURRENT_GRPC_VERSION
}
grpc_python {
path = "$projectDir/grpc_plugins/grpc_python_plugin_1.28.1-${osdetector.classifier}"
}
grpc_swift {
path = "$projectDir/grpc_plugins/protoc-gen-grpc-swift-$osdetector.classifier"
}
}
generateProtoTasks {
all().each { task ->
@@ -32,12 +43,16 @@ protobuf {
python {}
}
task.plugins {
swift{}
grpc { // Options added to --grpc_out
option 'lite'
}
grpc_python {
outputSubDir = 'python'
}
grpc_swift {
outputSubDir = 'swift'
}
}
}
}
@@ -47,8 +62,13 @@ task packPythonGrpc(type: Zip, dependsOn: protobuf.generateProtoTasks.all()) {
from protobuf.generatedFilesBaseDir + '/main/python'
}
task packSwiftGrpc(type: Zip, dependsOn: protobuf.generateProtoTasks.all()) {
from protobuf.generatedFilesBaseDir + '/main/swift'
}
artifacts {
python(packPythonGrpc)
swift(packSwiftGrpc)
}
dependencies {

Binary file not shown.

Binary file not shown.