-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
262 additions
and
241 deletions.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Generated by buf. DO NOT EDIT. | ||
version: v1 | ||
deps: | ||
- remote: buf.build | ||
owner: cosmos | ||
repository: cosmos-proto | ||
commit: 1935555c206d4afb9e94615dfd0fad31 | ||
- remote: buf.build | ||
owner: cosmos | ||
repository: gogo-proto | ||
commit: 34d970b699f84aa382f3c29773a60836 | ||
- remote: buf.build | ||
owner: googleapis | ||
repository: googleapis | ||
commit: 75b4300737fb4efca0831636be94e517 |
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,26 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
# How to run manually: | ||
# docker build --pull --rm -f "contrib/devtools/Dockerfile" -t cosmossdk-proto:latest "contrib/devtools" | ||
# docker run --rm -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh | ||
|
||
generate_protos() { | ||
package="$1" | ||
proto_dirs=$(find $package -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) | ||
for dir in $proto_dirs; do | ||
for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do | ||
if grep go_package "$file" &>/dev/null; then | ||
buf generate --template buf.gen.gogo.yaml "$file" | ||
fi | ||
done | ||
done | ||
} | ||
set -e | ||
|
||
echo "Generating gogo proto code" | ||
cd proto | ||
|
||
generate_protos "./comdex" | ||
proto_dirs=$(find ./comdex -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) | ||
for dir in $proto_dirs; do | ||
for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do | ||
# this regex checks if a proto file has its go_package set to cosmossdk.io/api/... | ||
# gogo proto files SHOULD ONLY be generated if this is false | ||
# we don't want gogo proto to run for proto files which are natively built for google.golang.org/protobuf | ||
if grep -q "option go_package" "$file" && grep -H -o -c 'option go_package.*cosmossdk.io/api' "$file" | grep -q ':0$'; then | ||
buf generate --template buf.gen.gogo.yaml $file | ||
fi | ||
done | ||
done | ||
|
||
cd .. | ||
|
||
# move proto files to the right places | ||
cp -r github.com/comdex-official/comdex/* ./ | ||
rm -rf github.com | ||
rm -rf github.com | ||
go mod tidy |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.