Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

protobuf java square write code-gen #868

Open
jpdna opened this issue Mar 22, 2017 · 3 comments
Open

protobuf java square write code-gen #868

jpdna opened this issue Mar 22, 2017 · 3 comments

Comments

@jpdna
Copy link
Contributor

jpdna commented Mar 22, 2017

#I'm trying to generate code from the GA4GH-schema proto files using:
https://github.com/square/wire

At the moment I am chasing down file dependencies as maven is telling me:

Wire Plugin: Failure compiling proto sources. Failed to locate google/protobuf/struct.proto

I note that:
https://github.com/ga4gh/ga4gh-schemas/blob/master/src/main/proto/ga4gh/variants.proto#L10

refers to "google/protobuf/struct.proto"

and GA4GH-schema repo contains a few of these proto files from google.api
https://github.com/ga4gh/ga4gh-schemas/tree/master/src/main/proto/google/api

but not struct.proto

I am curious as to why we include in our GA4GH-schema repo these annotations.proto and http.proto files at all as they don't seem project specific (did we require some custom hacked version?), and why struct.proto is not there. I can find it here:

https://github.com/google/protobuf/tree/master/src/google/protobuf
but am concerned with the versioning, and think it is strange we have our own copies anyhow.

Here is my non-working attempt to use square write pb code-gen:
https://github.com/jpdna/mango/tree/wire_proto

@heuermh may have thoughts as well

@david4096
Copy link
Member

Google ships the struct.proto here https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto which is included when you do protoc.

@ejacox
Copy link
Contributor

ejacox commented Mar 22, 2017

As for why we have our own copies:
#696

Is this too much of an implementation detail? Would the APIs be cleaner without them?

@david4096
Copy link
Member

Protobuf gives you a nice way to namespace packages, and including them is done with a -I just like one might imagine for compiling C code. I would like to keep them in a separate repository, but we need to offer a way to easily get them (for people like Justin), when they go to compile. Until there's a "proto repository" of sorts, some combination of keeping your own copy, git submodules, or downloading via a script are our best options. I think we could close this by adding the struct.proto to our repo. Since we use protoc we get some of Google's dependencies for free.

I'm really happy to learn about Wire, we need alternative implementations of protobuf, especially at the code generation end.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants