Commit 6e86664 1 parent 4d19263 commit 6e86664 Copy full SHA for 6e86664
File tree 2 files changed +32
-12
lines changed
2 files changed +32
-12
lines changed Original file line number Diff line number Diff line change @@ -92,3 +92,32 @@ install: go.sum
92
92
93
93
build :
94
94
go build $(BUILD_FLAGS ) -o bin/migalood ./cmd/migalood
95
+
96
+ # ##############################################################################
97
+ # ## Proto ###
98
+ # ##############################################################################
99
+
100
+ protoVer =0.11.6
101
+ protoImageName =ghcr.io/cosmos/proto-builder:$(protoVer )
102
+ containerProtoGen =proto-gen-$(protoVer )
103
+ containerProtoFmt =proto-fmt-$(protoVer )
104
+
105
+ proto-all : proto-format proto-gen
106
+
107
+ proto-gen :
108
+ @echo " Generating Protobuf files"
109
+ @if docker ps -a --format ' {{.Names}}' | grep -Eq " ^${containerProtoGen} $$ " ; then docker start -a $(containerProtoGen ) ; else docker run --name $(containerProtoGen ) -v $(CURDIR ) :/workspace --workdir /workspace $(protoImageName ) \
110
+ sh ./scripts/protocgen.sh; fi
111
+
112
+ proto-format :
113
+ @echo " Formatting Protobuf files"
114
+ @if docker ps -a --format ' {{.Names}}' | grep -Eq " ^${containerProtoFmt} $$ " ; then docker start -a $(containerProtoFmt ) ; else docker run --name $(containerProtoFmt ) -v $(CURDIR ) :/workspace --workdir /workspace tendermintdev/docker-build-proto \
115
+ find ./ -not -path " ./third_party/*" -name " *.proto" -exec clang-format -i {} \; ; fi
116
+
117
+ proto-lint :
118
+ @$(DOCKER_BUF ) lint --error-format=json
119
+
120
+ proto-check-breaking :
121
+ @$(DOCKER_BUF ) breaking --against $(HTTPS_GIT ) # branch=main
122
+
123
+ .PHONY : proto-all proto-gen proto-format proto-lint proto-check-breaking
Original file line number Diff line number Diff line change 2
2
3
3
set -eo pipefail
4
4
5
- protoc_install_proto_gen_doc () {
6
- echo " Installing protobuf protoc-gen-doc plugin"
7
- (go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest 2> /dev/null)
8
- }
5
+ # get protoc executions
6
+ go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos 2> /dev/null
9
7
10
8
echo " Generating gogo proto code"
11
9
cd proto
12
- proto_dirs=$( find ./cosmwasm -path -prune -o -name ' *.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
10
+ proto_dirs=$( find ./migaloo -path -prune -o -name ' *.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
13
11
for dir in $proto_dirs ; do
14
12
for file in $( find " ${dir} " -maxdepth 1 -name ' *.proto' ) ; do
15
13
if grep " option go_package" $file & > /dev/null ; then
@@ -18,15 +16,8 @@ for dir in $proto_dirs; do
18
16
done
19
17
done
20
18
21
- protoc_install_proto_gen_doc
22
-
23
- echo " Generating proto docs"
24
- buf generate --template buf.gen.doc.yml
25
-
26
19
cd ..
27
20
28
- # move proto files to the right places
29
- cp -r github.com/CosmWasm/wasmd/* ./
30
21
rm -rf github.com
31
22
32
23
go mod tidy
You can’t perform that action at this time.
0 commit comments