diff --git a/Makefile b/Makefile index 353b8a5d2..f56239b50 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,7 @@ proto-gen: .PHONY: proto-gen proto-lint: - @$(DOCKER_PROTO_BUILDER) buf lint --error-format=json + @$(DOCKER_PROTO_BUILDER) sh ./scripts/proto-lint.sh .PHONY: proto-lint proto-format: @@ -98,11 +98,11 @@ proto-format: .PHONY: proto-format proto-check-breaking: - @$(DOCKER_PROTO_BUILDER) buf breaking --against .git#branch=master + @$(DOCKER_PROTO_BUILDER) sh export AGAINST=".git#branch=master" && ./scripts/proto-check-breaking.sh .PHONY: proto-check-breaking proto-check-breaking-ci: - @$(DOCKER_PROTO_BUILDER) buf breaking --against $(HTTPS_GIT)#branch=master + @$(DOCKER_PROTO_BUILDER) export AGAINST="$(HTTPS_GIT)"; sh ./scripts/proto-check-breaking.sh "$(HTTPS_GIT)" .PHONY: proto-check-breaking-ci ############################################################################### diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 8e121448b..bfa06ca3e 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -9,17 +9,7 @@ set -euo pipefail : ${VERS:=master} echo "fetching proto files" - -# Get shortened ref of commit -REF=$(curl -H "Accept: application/vnd.github.v3.sha" -qL \ - "https://api.github.com/repos/tendermint/spec/commits/${VERS}" \ - | cut -c -7) - -readonly OUTDIR="tendermint-spec-${REF}" -curl -qL "https://api.github.com/repos/tendermint/spec/tarball/${REF}" | tar -xzf - ${OUTDIR}/ - -cp -r ${OUTDIR}/proto/tendermint/* ./proto/tendermint -cp -r ${OUTDIR}/third_party/** ./third_party +OUTDIR=$(VERS=$VERS sh ./scripts/fetch-spec-protos.sh) MODNAME="$(go list -m)" find ./proto/tendermint -name '*.proto' -not -path "./proto/tendermint/abci/types.proto" \ @@ -28,7 +18,6 @@ find ./proto/tendermint -name '*.proto' -not -path "./proto/tendermint/abci/type # For historical compatibility, the abci file needs to get a slightly different import name # so that it can be moved into the ./abci/types directory. sh ./scripts/protopackage.sh ./proto/tendermint/abci/types.proto $MODNAME "abci/types" - buf generate --path proto/tendermint --template ./${OUTDIR}/buf.gen.yaml --config ./${OUTDIR}/buf.yaml mv ./proto/tendermint/abci/types.pb.go ./abci/types @@ -37,8 +26,4 @@ echo "proto files have been compiled" echo "removing copied files" -find ${OUTDIR}/proto/tendermint/ -name *.proto \ - | sed "s/$OUTDIR\/\(.*\)/\1/g" \ - | xargs -I {} rm {} - -rm -rf ${OUTDIR} +OUTDIR=$OUTDIR sh ./scripts/clear-spec-protos.sh diff --git a/third_party/proto/gogoproto/gogo.proto b/third_party/proto/gogoproto/gogo.proto index 27960ecfb..31c516cd0 100644 --- a/third_party/proto/gogoproto/gogo.proto +++ b/third_party/proto/gogoproto/gogo.proto @@ -144,4 +144,4 @@ extend google.protobuf.FieldOptions { optional bool wktpointer = 65012; optional string castrepeated = 65013; -} \ No newline at end of file +}