-
Notifications
You must be signed in to change notification settings - Fork 356
/
Copy pathMakefileDoc
42 lines (32 loc) · 1.92 KB
/
MakefileDoc
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
###############################################################################
### Documentation ###
###############################################################################
include third_party/cosmos-sdk/contrib/devtools/Makefile
containerProtoVer=v0.2
containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer)
BINDIR ?= ~/go/bin
all: update-swagger-docs
proto-swagger-gen:
@echo "Generating Protobuf Swagger"
@docker run --rm -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protoc-swagger-gen.sh
@echo "Patch swagger documentations"
@sed -i"" "s/cosmosvaloper16xyempempp92x9hyzz9wrgf94r6j9h5f2w4n2l/crocncl16xyempempp92x9hyzz9wrgf94r6j9h5f2w4n2l/" app/docs/swagger-ui/swagger.yaml
@sed -i"" "s/cosmos16xyempempp92x9hyzz9wrgf94r6j9h5f06pxxv/cro16xyempempp92x9hyzz9wrgf94r6j9h5f06pxxv/" app/docs/swagger-ui/swagger.yaml
@sed -i"" "s/cosmosvalconspub1zcjduepq0vu2zgkgk49efa0nqwzndanq5m4c7pa3u4apz4g2r9gspqg6g9cs3k9cuf/crocnclconspub1zcjduepq0vu2zgkgk49efa0nqwzndanq5m4c7pa3u4apz4g2r9gspqg6g9cs3k9cuf/" app/docs/swagger-ui/swagger.yaml
@sed -i"" "s/example: Cosmos-Hub/example: crypto-org-chain-mainnet/" app/docs/swagger-ui/swagger.yaml
proto-gen:
@echo "Generating Protobuf files"
@docker run --rm -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protocgen
proto-format:
@echo "Formatting Protobuf files"
find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \;
proto-all: proto-format proto-gen
update-swagger-docs: statik
$(BINDIR)/statik -src=app/docs/swagger-ui -dest=app/docs -f -m
@if [ -n "$(git status --porcelain)" ]; then \
echo "\033[91mSwagger docs are out of sync!!!\033[0m";\
exit 1;\
else \
echo "\033[92mSwagger docs are in sync\033[0m";\
fi
.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint update-swagger-docs