forked from realiotech/multi-staking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (47 loc) · 2.46 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/make -f
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.0.0-rc8
###############################################################################
### Protobuf ###
###############################################################################
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
proto-all: proto-format proto-lint proto-gen
proto-gen:
@echo "Generating Protobuf files"
@$(protoImage) sh ./scripts/protocgen.sh
proto-format:
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;
proto-lint:
@$(protoImage) buf lint --error-format=json
proto-check-breaking:
@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main
CMT_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.38.0-alpha.2/proto/tendermint
CMT_CRYPTO_TYPES = proto/tendermint/crypto
CMT_ABCI_TYPES = proto/tendermint/abci
CMT_TYPES = proto/tendermint/types
CMT_VERSION = proto/tendermint/version
CMT_LIBS = proto/tendermint/libs/bits
CMT_P2P = proto/tendermint/p2p
proto-update-deps:
@echo "Updating Protobuf dependencies"
@mkdir -p $(CMT_ABCI_TYPES)
@curl -sSL $(CMT_URL)/abci/types.proto > $(CMT_ABCI_TYPES)/types.proto
@mkdir -p $(CMT_VERSION)
@curl -sSL $(CMT_URL)/version/types.proto > $(CMT_VERSION)/types.proto
@mkdir -p $(CMT_TYPES)
@curl -sSL $(CMT_URL)/types/types.proto > $(CMT_TYPES)/types.proto
@curl -sSL $(CMT_URL)/types/evidence.proto > $(CMT_TYPES)/evidence.proto
@curl -sSL $(CMT_URL)/types/params.proto > $(CMT_TYPES)/params.proto
@curl -sSL $(CMT_URL)/types/validator.proto > $(CMT_TYPES)/validator.proto
@curl -sSL $(CMT_URL)/types/block.proto > $(CMT_TYPES)/block.proto
@mkdir -p $(CMT_CRYPTO_TYPES)
@curl -sSL $(CMT_URL)/crypto/proof.proto > $(CMT_CRYPTO_TYPES)/proof.proto
@curl -sSL $(CMT_URL)/crypto/keys.proto > $(CMT_CRYPTO_TYPES)/keys.proto
@mkdir -p $(CMT_LIBS)
@curl -sSL $(CMT_URL)/libs/bits/types.proto > $(CMT_LIBS)/types.proto
@mkdir -p $(CMT_P2P)
@curl -sSL $(CMT_URL)/p2p/types.proto > $(CMT_P2P)/types.proto
$(DOCKER) run --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf mod update
.PHONY: proto-all proto-gen proto-format proto-lint proto-check-breaking proto-update-deps