The repository contains two main components located in cmd/protoc-gen-gorums
:
- dev: Contains static code and code generated by templates.
In other words, this is the code that the
protoc-gen-gorums
plugin will output. All files that are not prefixed byzorums*
and do not end in_test.go
get bundled intotemplate_static.go
. - gengorums: Contains the code for the
protoc-gen-gorums
plugin, as well as templates.
-
Changes should be made to the development code in
dev
:- Changes to "dynamic" code, i.e. code that is dependent on protobuf
definitions, should by done be editing the respective
.tmpl
files. - Changes to "static" code, i.e. code that is not dependent on
protobuf definitions, should be done by editing the respective
.go
files.
- Changes to "dynamic" code, i.e. code that is dependent on protobuf
definitions, should by done be editing the respective
-
Any changes to templates or static code requires the invocation of
make
. This is to:- Bundle the static code into
template_static.go
- Rebuild the
protoc-gen-gorums
plugin - Update the
zorums_*_gorums.pb.go
files
- Bundle the static code into
See the Makefile for more details.
Testing the protoc-gen-gorums
plugin itself can be done by running the make gentests
.
These tests verify that the code generated by the plugin is correct and stable.
Testing the generated code can be done by running tests in the tests/
folder.
See benchmarking.md
Below is a description of the current Makefile targets. The Makefile itself also serves as documentation; inspect it for details.
Target | Description |
---|---|
dev |
updates template_static.go and regenerates generated files from templates. |
benchmark |
Compiles the benchmark. |
tools |
Installs required tools such as protoc-gen-go and protoc-gen-go-grpc . |
installgorums |
Reinstalls the protoc-gen-gorums plugin. |
bootstrapgorums |
Used to bootstrap the plugin. |
gentests |
Generate code from test files. |
stability |
Used to test that plugin output is stable across consecutive runs. |