diff --git a/CarControlleriOS/CarController/Podfile b/CarControlleriOS/CarController/Podfile index a14c476..215eb47 100644 --- a/CarControlleriOS/CarController/Podfile +++ b/CarControlleriOS/CarController/Podfile @@ -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 diff --git a/CarControlleriOS/build.gradle b/CarControlleriOS/build.gradle new file mode 100644 index 0000000..e69de29 diff --git a/protobuf/build.gradle b/protobuf/build.gradle index eb9fd29..a8e7b78 100644 --- a/protobuf/build.gradle +++ b/protobuf/build.gradle @@ -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 { diff --git a/protobuf/grpc_plugins/protoc-gen-grpc-swift-osx-x86_64 b/protobuf/grpc_plugins/protoc-gen-grpc-swift-osx-x86_64 new file mode 100755 index 0000000..620e612 Binary files /dev/null and b/protobuf/grpc_plugins/protoc-gen-grpc-swift-osx-x86_64 differ diff --git a/protobuf/grpc_plugins/protoc-gen-swift b/protobuf/grpc_plugins/protoc-gen-swift new file mode 100755 index 0000000..4da327b Binary files /dev/null and b/protobuf/grpc_plugins/protoc-gen-swift differ