Categorygithub.com/ngyewch/protoc-gen-twirp-java
modulepackage
0.4.0
Repository: https://github.com/ngyewch/protoc-gen-twirp-java.git
Documentation: pkg.go.dev

# README

GitHub Workflow Status (with event) GitHub tag (with filter) Maven Central Version

protoc-gen-twirp-java

Twirp protobuf generator for Java.

Usage notes

IMPORTANT Declare option go_package in your .proto files even if you do not plan to generate Go source.

Example project

See github.com/ngyewch/protoc-gen-twirp-java-example

Usage

build.gradle.kts

import com.google.protobuf.gradle.id

plugins {
    id("com.google.protobuf") version "0.9.4"
    // ...
}

dependencies {
    implementation(platform("io.github.ngyewch.twirp:twirp-bom:0.3.0"))

    // Protobuf
    implementation("com.google.protobuf:protobuf-java")

    // Common
    implementation("io.github.ngyewch.twirp:twirp-common")
    
    // Apache HttpComponents
    implementation("io.github.ngyewch.twirp:twirp-apache-client")

    // Helidon
    implementation("io.github.ngyewch.twirp:twirp-helidon-common")

    // Helidon client
    implementation("io.github.ngyewch.twirp:twirp-helidon-client")

    // Helidon server
    implementation("io.github.ngyewch.twirp:twirp-helidon-server")
    implementation("io.helidon.common:helidon-common-http")
    implementation("io.helidon.common:helidon-common-reactive")
    implementation("io.helidon.webserver:helidon-webserver")

    // ...
}

protobuf {
    plugins {
        id("twirp-java") {
            artifact = "io.github.ngyewch.twirp:protoc-gen-twirp-java:0.3.0"
        }
    }
    protoc {
        artifact = "com.google.protobuf:protoc:4.28.2"
    }
    generateProtoTasks {
        ofSourceSet("main").forEach {
            it.plugins {
                id("twirp-java") {
                    option("gen-helidon-client=true")
                    option("gen-helidon-server=true")
                    option("gen-apache-client=true")
                }
            }
        }
    }
}

// ...

Options

NameTypeDefaultDescription
gen-helidon-clientbooleanfalseGenerate Helidon SE WebClient based client.
gen-helidon-serverbooleanfalseGenerate Helidon SE WebServer based server.
gen-apache-clientbooleanfalseGenerate Apache HttpComponents based client.

# Packages

No description provided by the author