Add swift grpc code-gen and use latest grpcSwift pod
This commit is contained in:
@@ -6,7 +6,7 @@ target 'CarController' do
|
|||||||
use_frameworks!
|
use_frameworks!
|
||||||
|
|
||||||
# Pods for CarController
|
# Pods for CarController
|
||||||
pod 'SwiftGRPC'
|
pod 'gRPC-Swift', '1.0.0-alpha.11'
|
||||||
pod 'SwiftyZeroMQ5'
|
pod 'SwiftyZeroMQ5'
|
||||||
pod 'SwiftProtobuf', '~> 1.0'
|
pod 'SwiftProtobuf', '~> 1.0'
|
||||||
end
|
end
|
||||||
|
|||||||
0
CarControlleriOS/build.gradle
Normal file
0
CarControlleriOS/build.gradle
Normal file
@@ -12,17 +12,28 @@ configurations {
|
|||||||
canBeResolved = false
|
canBeResolved = false
|
||||||
canBeConsumed = true
|
canBeConsumed = true
|
||||||
}
|
}
|
||||||
|
// For Swift Codegen
|
||||||
|
swift {
|
||||||
|
canBeConsumed = true
|
||||||
|
canBeResolved = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protobuf {
|
protobuf {
|
||||||
protoc { artifact = 'com.google.protobuf:protoc:3.11.0' }
|
protoc { artifact = 'com.google.protobuf:protoc:3.11.0' }
|
||||||
plugins {
|
plugins {
|
||||||
|
swift {
|
||||||
|
path = "$projectDir/grpc_plugins/protoc-gen-swift"
|
||||||
|
}
|
||||||
grpc {
|
grpc {
|
||||||
artifact = 'io.grpc:protoc-gen-grpc-java:1.28.1' // CURRENT_GRPC_VERSION
|
artifact = 'io.grpc:protoc-gen-grpc-java:1.28.1' // CURRENT_GRPC_VERSION
|
||||||
}
|
}
|
||||||
grpc_python {
|
grpc_python {
|
||||||
path = "$projectDir/grpc_plugins/grpc_python_plugin_1.28.1-${osdetector.classifier}"
|
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 {
|
generateProtoTasks {
|
||||||
all().each { task ->
|
all().each { task ->
|
||||||
@@ -32,12 +43,16 @@ protobuf {
|
|||||||
python {}
|
python {}
|
||||||
}
|
}
|
||||||
task.plugins {
|
task.plugins {
|
||||||
|
swift{}
|
||||||
grpc { // Options added to --grpc_out
|
grpc { // Options added to --grpc_out
|
||||||
option 'lite'
|
option 'lite'
|
||||||
}
|
}
|
||||||
grpc_python {
|
grpc_python {
|
||||||
outputSubDir = 'python'
|
outputSubDir = 'python'
|
||||||
}
|
}
|
||||||
|
grpc_swift {
|
||||||
|
outputSubDir = 'swift'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,8 +62,13 @@ task packPythonGrpc(type: Zip, dependsOn: protobuf.generateProtoTasks.all()) {
|
|||||||
from protobuf.generatedFilesBaseDir + '/main/python'
|
from protobuf.generatedFilesBaseDir + '/main/python'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task packSwiftGrpc(type: Zip, dependsOn: protobuf.generateProtoTasks.all()) {
|
||||||
|
from protobuf.generatedFilesBaseDir + '/main/swift'
|
||||||
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
python(packPythonGrpc)
|
python(packPythonGrpc)
|
||||||
|
swift(packSwiftGrpc)
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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