-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (50 loc) · 2.66 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
mock-expected-keepers:
mockgen -source=x/checkers/types/expected_keepers.go \
-package testutil \
-destination=x/checkers/testutil/expected_keepers_mocks.go
mockgen -source=x/leaderboard/types/expected_keepers.go \
-package testutil \
-destination=x/leaderboard/testutil/expected_keepers_mocks.go
install-protoc-gen-ts:
mkdir -p scripts/protoc
cd scripts && npm install
curl -L https://github.com/protocolbuffers/protobuf/releases/download/v21.5/protoc-21.5-linux-x86_64.zip -o scripts/protoc/protoc.zip
cd scripts/protoc && unzip -o protoc.zip
rm scripts/protoc/protoc.zip
ln -s $(pwd)/scripts/protoc/bin/protoc /usr/local/bin/protoc
cosmos-version = v0.45.4
download-cosmos-proto:
mkdir -p proto/cosmos/base/query/v1beta1
curl https://raw.githubusercontent.com/cosmos/cosmos-sdk/${cosmos-version}/proto/cosmos/base/query/v1beta1/pagination.proto -o proto/cosmos/base/query/v1beta1/pagination.proto
mkdir -p proto/google/api
curl https://raw.githubusercontent.com/cosmos/cosmos-sdk/${cosmos-version}/third_party/proto/google/api/annotations.proto -o proto/google/api/annotations.proto
curl https://raw.githubusercontent.com/cosmos/cosmos-sdk/${cosmos-version}/third_party/proto/google/api/http.proto -o proto/google/api/http.proto
mkdir -p proto/gogoproto
curl https://raw.githubusercontent.com/cosmos/cosmos-sdk/${cosmos-version}/third_party/proto/gogoproto/gogo.proto -o proto/gogoproto/gogo.proto
gen-protoc-ts:
mkdir -p ./client/src/types/generated/
ls proto/checkers | xargs -I {} protoc \
--plugin="./scripts/node_modules/.bin/protoc-gen-ts_proto" \
--ts_proto_out="./client/src/types/generated" \
--proto_path="./proto" \
--ts_proto_opt="esModuleInterop=true,forceLong=long,useOptionals=messages" \
checkers/{}
install-and-gen-protoc-ts: download-cosmos-proto install-protoc-gen-ts gen-protoc-ts
build-linux:
GOOS=linux GOARCH=amd64 go build -o ./build/checkersd-linux-amd64 ./cmd/checkersd/main.go
GOOS=linux GOARCH=arm64 go build -o ./build/checkersd-linux-arm64 ./cmd/checkersd/main.go
do-checksum-linux:
cd build && sha256sum \
checkersd-linux-amd64 checkersd-linux-arm64 \
> checkers-checksum-linux
build-linux-with-checksum: build-linux do-checksum-linux
build-darwin:
GOOS=darwin GOARCH=amd64 go build -o ./build/checkersd-darwin-amd64 ./cmd/checkersd/main.go
GOOS=darwin GOARCH=arm64 go build -o ./build/checkersd-darwin-arm64 ./cmd/checkersd/main.go
build-all: build-linux build-darwin
do-checksum-darwin:
cd build && sha256sum \
checkersd-darwin-amd64 checkersd-darwin-arm64 \
> checkers-checksum-darwin
build-darwin-with-checksum: build-darwin do-checksum-darwin
build-with-checksum: build-linux-with-checksum build-darwin-with-checksum