This is a very simple demo of a Protocol Buffer Compiler (protoc) plugin written in Java. The demo processes one or more .proto files as provided by protoc, and generates JSON representing the enums and messages defined there.
This is a standard Maven project - mvn clean package will build the demo as a shaded JAR.
There are two shell scripts in this project.
plugin_wrapper.sh
This script wraps up the invocation of the plugin-JAR file so that it can be executed by protoc.
runprotoc.sh
This script runs the protoc compiler, using the demo plugin.
A sample hello.proto file is provided.
When the runprotoc.sh script is executed, it will run protoc, which will invoke the plugin, which will write a JSON file to the project's ./output folder.
The protoc compiler must be installed and available on your PATH
Download the protoc binary, if necessary:
See the Protobuf Releases page.
The protoc version used in this demo can be downloaded here.
The following Java packages are used: