plugins { id 'java' id 'com.google.protobuf' id 'idea' id "com.google.osdetector" } configurations { // For grpc python codegen. python { canBeResolved = false canBeConsumed = true } // For Swift Codegen swift { canBeConsumed = true canBeResolved = false } } protobuf { protoc { artifact = 'com.google.protobuf:protoc:4.29.3' } plugins { grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.57.0' // CURRENT_GRPC_VERSION } // grpc_python { // path = "$projectDir/grpc_plugins/grpc_python_plugin_1.28.1-${osdetector.classifier}" // } } generateProtoTasks { all().each { task -> task.builtins { java { option 'lite' } python {} } task.plugins { grpc { // Options added to --grpc_out option 'lite' } } } } } 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 { implementation 'io.grpc:grpc-okhttp:1.29.0' // CURRENT_GRPC_VERSION implementation 'io.grpc:grpc-protobuf-lite:1.57.0' // CURRENT_GRPC_VERSION implementation 'io.grpc:grpc-stub:1.57.0' // CURRENT_GRPC_VERSION implementation 'javax.annotation:javax.annotation-api:1.3.2' }