Skip to content

Commit

Permalink
fix: correctly generate and test testproto/
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Stewart <[email protected]>
  • Loading branch information
paralin committed Apr 15, 2024
1 parent b460ea1 commit 2bb48f7
Show file tree
Hide file tree
Showing 14 changed files with 17,149 additions and 1,917 deletions.
40 changes: 16 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,29 +75,21 @@ gengo: $(GOIMPORTS) $(PROTOWRAP) $(PROTOC_GEN_GO)
mkdir -p $$(pwd)/vendor/$$(dirname $${PROJECT}); \
rm $$(pwd)/vendor/$${PROJECT} || true; \
ln -s $$(pwd) $$(pwd)/vendor/$${PROJECT} ; \
$(PROTOWRAP) \
-I $$(pwd)/vendor \
-I $$(pwd) \
--go-lite_out=$$(pwd)/vendor \
--proto_path $$(pwd)/vendor \
--print_structure \
--only_specified_files \
$$(\
git \
ls-files "types/*.proto" |\
xargs printf -- \
"$$(pwd)/vendor/$${PROJECT}/%s "); \
$(PROTOWRAP) \
-I $$(pwd)/vendor \
-I $$(pwd) \
--go-lite_out=$$(pwd)/vendor \
--proto_path $$(pwd)/vendor \
--print_structure \
--only_specified_files \
$$(\
git \
ls-files "testproto/*.proto" |\
xargs printf -- \
"$$(pwd)/vendor/$${PROJECT}/%s "); \
protogen() { \
$(PROTOWRAP) \
-I $$(pwd)/vendor \
-I $$(pwd) \
--go-lite_out=$$(pwd)/vendor \
--proto_path $$(pwd)/vendor \
--print_structure \
--only_specified_files \
$$(\
git \
ls-files "$$1" |\
xargs printf -- \
"$$(pwd)/vendor/$${PROJECT}/%s "); \
}; \
protogen "./types/*.proto"; \
protogen "./testproto/*.proto"; \
rm $$(pwd)/vendor/$${PROJECT} || true
$(GOIMPORTS) -w ./
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Lightweight Protobuf 3 RPCs are implemented in [StaRPC] for Go and TypeScript.

[StaRPC]: https://github.com/aperturerobotics/starpc

[protoc-gen-doc] is recommended for generating documentation.

[protoc-gen-doc]: https://github.com/pseudomuto/protoc-gen-doc

## Protobuf

[protocol buffers](https://protobuf.dev) are a cross-platform cross-language
Expand Down
63 changes: 3 additions & 60 deletions testproto/empty/empty.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion testproto/empty/empty.proto
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
syntax = "proto3";
option go_package = "testproto/empty";
Loading

0 comments on commit 2bb48f7

Please sign in to comment.