plugins { id 'java-library' id 'com.google.protobuf' } dependencies { api "com.google.protobuf:protobuf-java-util:${protobufVersion}" api "com.google.protobuf:protobuf-java:${protobufVersion}" api "io.grpc:grpc-protobuf:${grpcVersion}" api "io.grpc:grpc-stub:${grpcVersion}" implementation "com.google.guava:guava:${guavaVersion}" implementation "io.grpc:grpc-netty-shaded:${grpcVersion}" compileOnly 'javax.annotation:javax.annotation-api:1.3.2' testImplementation "com.google.code.gson:gson:${gsonVersion}" testImplementation "io.grpc:grpc-inprocess:${grpcVersion}" testImplementation "io.grpc:grpc-testing:${grpcVersion}" } sourceSets { main { proto { srcDir rootProject.file('../../src/MxGateway.Contracts/Protos') include 'mxaccess_gateway.proto' include 'mxaccess_worker.proto' include 'galaxy_repository.proto' } } } protobuf { protoc { artifact = "com.google.protobuf:protoc:${protobufVersion}" } plugins { grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" } } generatedFilesBaseDir = rootProject.file('src/main/generated').absolutePath generateProtoTasks { all().configureEach { plugins { grpc {} } } } }