TheThingsArchive / api

Generated code for accessing The Things Network v2 API
MIT License
12 stars 8 forks source link

Generated Java source files depend on com.google.protobuf.GoGoProtos class #30

Closed singularsyntax closed 3 years ago

singularsyntax commented 6 years ago

The API build process uses gogoprotobuf which extends standard protobufs. Thus, the generated Java source files contain references to GoGoProtos classes and fails to build:

[ERROR] /Development/ttn-playground/java-app-api/src/main/java/org/thethingsnetwork/api/protocol/ProtocolProto.java:[75,30] cannot find symbol
  symbol:   class GoGoProtos
  location: package com.google.protobuf

Presumably, the protobufs import resolution process retrieves and generates these source files as well, but they are not checked in. Would it be straightforward to check these into the Git repository as well, so that the Java classes can be compiled?

Unfortunately, build issues (#29) prevent me from attempting to generate the GoGoProtos classes in my own environment.

htdvisser commented 6 years ago

For JS and Python we just run sed to delete all lines containing references to the (unused) gogo and annotations. That may also be a solution here, in which case we shoul probably remove all references to com.google.api.AnnotationsProto or com.google.protobuf.GoGoProtos from the generated Java code.

singularsyntax commented 6 years ago

Removing references to those two classes throughout the generated Java source files tree does indeed fix the compilation failure.

htdvisser commented 5 years ago

Hi @singularsyntax, I added a post-process rule to the Makefile that deletes references to GoGo and AnnotationsProto from the Java files. I pushed the commit to https://github.com/TheThingsNetwork/api/tree/feature/gogo-java, could you check that branch to see if it works for you?

htdvisser commented 3 years ago

I'm going to close this issue. We're not going to address it anymore, as V2 is going to shut down in December.