I’ve created an extension that registers a list of classes for reflection (instead of adding them with the @RegisterForReflection
annotation).
A couple of problems:
- The classes that require registration can change in the future as they are a list of Protos and we can add new messages
- The classes that need registration are nested classes as they are automatically generated by protoc
- It looks like there’s no way to register a whole package automatically, we have to list each individual class
The tests can call the com.google.protobuf.util.JsonFormat.printer().print()
which goes through the list of fields using reflection and caused the issue in the first place – so if it fails it means that there are missing classes.
But is there a way to test the native executable from the extension?