Do you want to generate Java code stubs by reflection? If so, you can use getproto gradle plugin
It would generate proto schemes via reflection and then you could use the Protobuf plugin to compile them.