protoc-gen-grpc-coroutines

The plugin protoc-gen-grpc-coroutines exposes the gRPC coroutines generator. This generator outputs the sources for both client and server gRPC stubs. This plugin is meant to simplify project setup for users that wish to only leverage the gRPC coroutines generator and does not require a Kroto+ configuration file to be supplied.

Available Generators

This plugin exposes the following generators:

Build Configuration

plugins{
    id 'com.google.protobuf' version '0.8.6'
}

protobuf {
    protoc { artifact = "com.google.protobuf:protoc:$protobufVersion"}

    plugins {
        grpc { artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion" }
        coroutines {
            artifact = "com.github.marcoferrer.krotoplus:protoc-gen-grpc-coroutines:$krotoPlusVersion"
        }
    }

    generateProtoTasks {
        all().each{ task ->
            task.plugins {
                grpc {}
                coroutines {}
            }
        }
    }
}
plugins{
    id("com.google.protobuf") version "0.8.6"
}

protobuf {
    protoc { artifact = "com.google.protobuf:protoc:$protobufVersion"}

    plugins {
        id("coroutines") {
            artifact = "com.github.marcoferrer.krotoplus:protoc-gen-grpc-coroutines:$krotoPlusVersion"
        }
        id("grpc") {
            artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
        }
    }

    generateProtoTasks {
        all().forEach { task ->
            task.plugins {
                id("coroutines")
                id("grpc")  
            }
        }
    }
}
<plugin>
    <groupId>org.xolstice.maven.plugins</groupId>
    <artifactId>protobuf-maven-plugin</artifactId>
    <version>0.6.1</version>
    <configuration>
        <protocArtifact>com.google.protobuf:protoc:3.6.1:exe:${os.detected.classifier}</protocArtifact>
    </configuration>
    <executions>
        <execution>
            <goals><goal>compile</goal></goals>
        </execution>
        <execution>
            <id>grpc-java</id>
            <goals><goal>compile-custom</goal></goals>
            <configuration>
                <pluginId>grpc-java</pluginId>
                <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.17.1:exe:${os.detected.classifier}</pluginArtifact>
            </configuration>
        </execution>
        <execution>
            <id>grpc-coroutines</id>
            <goals>
                <goal>compile-custom</goal>
            </goals>
            <configuration>
                <pluginId>grpc-coroutines</pluginId>
                <pluginArtifact>com.github.marcoferrer.krotoplus:protoc-gen-grpc-coroutines:${krotoPlusVersion}:exe:${os.detected.classifier}</pluginArtifact>
            </configuration>
        </execution>
    </executions>
</plugin>