forked from cerc-io/laconicd-deprecated
stargate: proto files (#679)
* stargate: proto files * third party proto files * third party proto files * add annotations * rm proto-gen-any * rm script any
This commit is contained in:
@@ -25,6 +25,10 @@ GO_MOD=GO111MODULE=on
|
||||
BUILDDIR ?= $(CURDIR)/build
|
||||
SIMAPP = ./app
|
||||
LEDGER_ENABLED ?= true
|
||||
HTTPS_GIT := https://github.com/cosmos/ethermint.git
|
||||
DOCKER := $(shell which docker)
|
||||
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf
|
||||
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
DETECTED_OS := windows
|
||||
@@ -340,33 +344,39 @@ format:
|
||||
### Protobuf ###
|
||||
###############################################################################
|
||||
|
||||
proto-all: proto-gen proto-lint proto-check-breaking
|
||||
proto-all: proto-format proto-lint proto-gen
|
||||
|
||||
proto-gen:
|
||||
@./scripts/protocgen.sh
|
||||
@echo "Generating Protobuf files"
|
||||
$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace tendermintdev/sdk-proto-gen sh ./scripts/protocgen.sh
|
||||
|
||||
proto-format:
|
||||
@echo "Formatting Protobuf files"
|
||||
$(DOCKER) run --rm -v $(CURDIR):/workspace \
|
||||
--workdir /workspace tendermintdev/docker-build-proto \
|
||||
find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \;
|
||||
|
||||
proto-swagger-gen:
|
||||
@./scripts/protoc-swagger-gen.sh
|
||||
|
||||
proto-lint:
|
||||
@buf check lint --error-format=json
|
||||
@$(DOCKER_BUF) check lint --error-format=json
|
||||
|
||||
# NOTE: should match the default repo branch
|
||||
proto-check-breaking:
|
||||
@buf check breaking --against-input '.git#branch=development'
|
||||
@$(DOCKER_BUF) check breaking --against-input $(HTTPS_GIT)#branch=development
|
||||
|
||||
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc6/proto/tendermint
|
||||
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
|
||||
COSMOS_SDK_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/master
|
||||
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
|
||||
|
||||
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.33.3
|
||||
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
|
||||
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
|
||||
SDK_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/master
|
||||
TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto
|
||||
TM_ABCI_TYPES = third_party/proto/tendermint/abci
|
||||
TM_TYPES = third_party/proto/tendermint/types
|
||||
|
||||
TM_KV_TYPES = third_party/proto/tendermint/libs/kv
|
||||
TM_MERKLE_TYPES = third_party/proto/tendermint/crypto/merkle
|
||||
TM_ABCI_TYPES = third_party/proto/tendermint/abci/types
|
||||
GOGO_PROTO_TYPES = third_party/proto/gogoproto
|
||||
COSMOS_PROTO_TYPES = third_party/proto/cosmos-proto
|
||||
SDK_PROTO_TYPES = third_party/proto/cosmos-sdk/types
|
||||
AUTH_PROTO_TYPES = third_party/proto/cosmos-sdk/x/auth/types
|
||||
VESTING_PROTO_TYPES = third_party/proto/cosmos-sdk/x/auth/vesting/types
|
||||
SUPPLY_PROTO_TYPES = third_party/proto/cosmos-sdk/x/supply/types
|
||||
COSMOS_SDK_PROTO = third_party/proto/cosmos-sdk
|
||||
COSMOS_PROTO_TYPES = third_party/proto/cosmos_proto
|
||||
|
||||
proto-update-deps:
|
||||
@mkdir -p $(GOGO_PROTO_TYPES)
|
||||
@@ -375,36 +385,22 @@ proto-update-deps:
|
||||
@mkdir -p $(COSMOS_PROTO_TYPES)
|
||||
@curl -sSL $(COSMOS_PROTO_URL)/cosmos.proto > $(COSMOS_PROTO_TYPES)/cosmos.proto
|
||||
|
||||
## Importing of tendermint protobuf definitions currently requires the
|
||||
## use of `sed` in order to build properly with cosmos-sdk's proto file layout
|
||||
## (which is the standard Buf.build FILE_LAYOUT)
|
||||
## Issue link: https://github.com/tendermint/tendermint/issues/5021
|
||||
@mkdir -p $(TM_ABCI_TYPES)
|
||||
@curl -sSL $(TM_URL)/abci/types/types.proto > $(TM_ABCI_TYPES)/types.proto
|
||||
@sed -i '' '8 s|crypto/merkle/merkle.proto|third_party/proto/tendermint/crypto/merkle/merkle.proto|g' $(TM_ABCI_TYPES)/types.proto
|
||||
@sed -i '' '9 s|libs/kv/types.proto|third_party/proto/tendermint/libs/kv/types.proto|g' $(TM_ABCI_TYPES)/types.proto
|
||||
@curl -sSL $(TM_URL)/abci/types.proto > $(TM_ABCI_TYPES)/types.proto
|
||||
|
||||
@mkdir -p $(TM_KV_TYPES)
|
||||
@curl -sSL $(TM_URL)/libs/kv/types.proto > $(TM_KV_TYPES)/types.proto
|
||||
@mkdir -p $(TM_TYPES)
|
||||
@curl -sSL $(TM_URL)/types/types.proto > $(TM_TYPES)/types.proto
|
||||
|
||||
@mkdir -p $(TM_MERKLE_TYPES)
|
||||
@curl -sSL $(TM_URL)/crypto/merkle/merkle.proto > $(TM_MERKLE_TYPES)/merkle.proto
|
||||
@mkdir -p $(TM_CRYPTO_TYPES)
|
||||
@curl -sSL $(TM_URL)/crypto/proof.proto > $(TM_CRYPTO_TYPES)/proof.proto
|
||||
@curl -sSL $(TM_URL)/crypto/keys.proto > $(TM_CRYPTO_TYPES)/keys.proto
|
||||
|
||||
@mkdir -p $(SDK_PROTO_TYPES)
|
||||
@curl -sSL $(SDK_PROTO_URL)/types/types.proto > $(SDK_PROTO_TYPES)/types.proto
|
||||
.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps
|
||||
|
||||
@mkdir -p $(AUTH_PROTO_TYPES)
|
||||
@curl -sSL $(SDK_PROTO_URL)/x/auth/types/types.proto > $(AUTH_PROTO_TYPES)/types.proto
|
||||
@sed -i '' '5 s|types/types.proto|third_party/proto/cosmos-sdk/types/types.proto|g' $(AUTH_PROTO_TYPES)/types.proto
|
||||
|
||||
@mkdir -p $(VESTING_PROTO_TYPES)
|
||||
curl -sSL $(SDK_PROTO_URL)/x/auth/vesting/types/types.proto > $(VESTING_PROTO_TYPES)/types.proto
|
||||
@sed -i '' '5 s|types/types.proto|third_party/proto/cosmos-sdk/types/types.proto|g' $(VESTING_PROTO_TYPES)/types.proto
|
||||
@sed -i '' '6 s|x/auth/types/types.proto|third_party/proto/cosmos-sdk/x/auth/types/types.proto|g' $(VESTING_PROTO_TYPES)/types.proto
|
||||
|
||||
@mkdir -p $(SUPPLY_PROTO_TYPES)
|
||||
curl -sSL $(SDK_PROTO_URL)/x/supply/types/types.proto > $(SUPPLY_PROTO_TYPES)/types.proto
|
||||
@sed -i '' '5 s|types/types.proto|third_party/proto/cosmos-sdk/types/types.proto|g' $(SUPPLY_PROTO_TYPES)/types.proto
|
||||
@sed -i '' '6 s|x/auth/types/types.proto|third_party/proto/cosmos-sdk/x/auth/types/types.proto|g' $(SUPPLY_PROTO_TYPES)/types.proto
|
||||
|
||||
|
||||
.PHONY: proto-all proto-gen proto-lint proto-check-breaking proto-update-deps
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
||||
Reference in New Issue
Block a user