-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: proto generation scripts #11133
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
413b7ff
chore: update protogen
robert-zaremba fd3baff
update function names
robert-zaremba 9d1ff84
update scripts
robert-zaremba b4ea591
update docs
robert-zaremba 3c597c6
Update scripts/protocgen.sh
robert-zaremba b41f09f
update docs
robert-zaremba daf6f7d
Merge branch 'master' into robert/protogen
tac0turtle 02cc31e
Merge branch 'master' into robert/protogen
amaury1093 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
#== Requirements == | ||
# | ||
## make sure your `go env GOPATH` is in the `$PATH` | ||
## Install: | ||
## + latest buf (v1.0.0-rc11 or later) | ||
## + protobuf v3 | ||
# | ||
## All protoc dependencies must be installed not in the module scope | ||
## currently we must use grpc-gateway v1 | ||
# cd ~ | ||
# go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
# go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
# go install github.com/grpc-ecosystem/grpc-gateway/[email protected] | ||
# go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest | ||
# go get github.com/regen-network/cosmos-proto@latest # doesn't work in install mode | ||
|
||
protoc_gen_gocosmos() { | ||
if ! grep "github.com/gogo/protobuf => github.com/regen-network/protobuf" go.mod &>/dev/null ; then | ||
echo -e "\tPlease run this command from somewhere inside the cosmos-sdk folder." | ||
return 1 | ||
fi | ||
set -eo pipefail | ||
|
||
go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@latest 2>/dev/null | ||
protoc_install_gocosmos() { | ||
echo "Installing protobuf gocosmos plugin" | ||
# we should use go install, but regen-network/cosmos-proto contains | ||
# replace directives. It must not contain directives that would cause | ||
# it to be interpreted differently than if it were the main module. | ||
# So the command below issues a warning and we are muting it for now. | ||
# | ||
# Installing plugins must be done outside of the module | ||
(cd ~; go get github.com/regen-network/cosmos-proto/[email protected] 2> /dev/null) | ||
} | ||
|
||
protoc_gen_gocosmos | ||
protoc_install_gocosmos | ||
|
||
echo "Generating gogo proto code" | ||
cd proto | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
|
||
|
||
# this script is for generating protobuf files for the new google.golang.org/protobuf API | ||
|
||
set -eo pipefail | ||
|
||
protoc_gen_gopulsar() { | ||
go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest 2>/dev/null | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest 2>/dev/null | ||
protoc_install_gopulsar() { | ||
go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
} | ||
|
||
protoc_gen_gopulsar | ||
protoc_install_gopulsar | ||
|
||
echo "Generating API module" | ||
(cd proto; buf generate --template buf.gen.pulsar.yaml) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how we all missed this, even me, but this breaks proto generation. We need it installed in the module not outside.