Skip to content

Tag: protocol-buffers

How to specify the Protobuf path using protobuf-gradle-plugin

I’m trying to generate Protobufs in a Java project that are defined in another Git repository that I’d like to add as a Git submodule. My build.gradle contains and I’ve included the protobufs repository (called my-protobufs) in the src/main/proto directory. The Protobufs are in turn located in a proto subdirectory of my-protobufs. A partial directory structure looks like this: The

Generic getDefaultInstance() for java protobuf

I’m trying to write a static util function that takes in a protobuf object and determine if it’s a default instance, something along the line of: Would like for it to be able to apply to a range of protobuf objects like Struct / Types / Messages, however getDefaultInstance() appears to only get defined in the child classes. I’m thinking