Add swift grpc code-gen and use latest grpcSwift pod
This commit is contained in:
@@ -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 {
|
||||
|
||||
BIN
protobuf/grpc_plugins/protoc-gen-grpc-swift-osx-x86_64
Executable file
BIN
protobuf/grpc_plugins/protoc-gen-grpc-swift-osx-x86_64
Executable file
Binary file not shown.
BIN
protobuf/grpc_plugins/protoc-gen-swift
Executable file
BIN
protobuf/grpc_plugins/protoc-gen-swift
Executable file
Binary file not shown.
Reference in New Issue
Block a user