-
Notifications
You must be signed in to change notification settings - Fork 42
/
codegen.sh
executable file
·205 lines (200 loc) · 8.96 KB
/
codegen.sh
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#!/bin/bash
set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"
OUT_DIR="./src"
PLUGIN_PATH="$(realpath ./bin)/protoc-gen-ts_proto_yarn_2"
mkdir -p "$OUT_DIR"
echo "Processing wasmd 0.16 proto files ..."
WASMD_DIR="./wasmd-0.16/proto"
WASMD_THIRD_PARTY_DIR="./wasmd-0.16/third_party/proto"
CONFIO_DIR="$WASMD_THIRD_PARTY_DIR/confio"
COSMOS_DIR="$WASMD_THIRD_PARTY_DIR/cosmos"
IBC_DIR="$WASMD_THIRD_PARTY_DIR/ibc"
protoc \
--plugin="$PLUGIN_PATH" \
--ts_proto_yarn_2_out="$OUT_DIR" \
--proto_path="$WASMD_DIR" \
--proto_path="$WASMD_THIRD_PARTY_DIR" \
--ts_proto_yarn_2_opt="esModuleInterop=true,forceLong=long,useOptionals=true" \
"$CONFIO_DIR/proofs.proto" \
"$COSMOS_DIR/auth/v1beta1/auth.proto" \
"$COSMOS_DIR/auth/v1beta1/genesis.proto" \
"$COSMOS_DIR/auth/v1beta1/query.proto" \
"$COSMOS_DIR/bank/v1beta1/bank.proto" \
"$COSMOS_DIR/bank/v1beta1/genesis.proto" \
"$COSMOS_DIR/bank/v1beta1/query.proto" \
"$COSMOS_DIR/bank/v1beta1/tx.proto" \
"$COSMOS_DIR/base/abci/v1beta1/abci.proto" \
"$COSMOS_DIR/base/kv/v1beta1/kv.proto" \
"$COSMOS_DIR/base/query/v1beta1/pagination.proto" \
"$COSMOS_DIR/base/reflection/v1beta1/reflection.proto" \
"$COSMOS_DIR/base/snapshots/v1beta1/snapshot.proto" \
"$COSMOS_DIR/base/store/v1beta1/commit_info.proto" \
"$COSMOS_DIR/base/store/v1beta1/snapshot.proto" \
"$COSMOS_DIR/base/tendermint/v1beta1/query.proto" \
"$COSMOS_DIR/base/v1beta1/coin.proto" \
"$COSMOS_DIR/capability/v1beta1/capability.proto" \
"$COSMOS_DIR/capability/v1beta1/genesis.proto" \
"$COSMOS_DIR/crisis/v1beta1/genesis.proto" \
"$COSMOS_DIR/crisis/v1beta1/tx.proto" \
"$COSMOS_DIR/crypto/ed25519/keys.proto" \
"$COSMOS_DIR/crypto/multisig/keys.proto" \
"$COSMOS_DIR/crypto/multisig/v1beta1/multisig.proto" \
"$COSMOS_DIR/crypto/secp256k1/keys.proto" \
"$COSMOS_DIR/distribution/v1beta1/distribution.proto" \
"$COSMOS_DIR/distribution/v1beta1/genesis.proto" \
"$COSMOS_DIR/distribution/v1beta1/query.proto" \
"$COSMOS_DIR/distribution/v1beta1/tx.proto" \
"$COSMOS_DIR/evidence/v1beta1/evidence.proto" \
"$COSMOS_DIR/evidence/v1beta1/genesis.proto" \
"$COSMOS_DIR/evidence/v1beta1/query.proto" \
"$COSMOS_DIR/evidence/v1beta1/tx.proto" \
"$COSMOS_DIR/genutil/v1beta1/genesis.proto" \
"$COSMOS_DIR/gov/v1beta1/genesis.proto" \
"$COSMOS_DIR/gov/v1beta1/gov.proto" \
"$COSMOS_DIR/gov/v1beta1/query.proto" \
"$COSMOS_DIR/gov/v1beta1/tx.proto" \
"$COSMOS_DIR/mint/v1beta1/genesis.proto" \
"$COSMOS_DIR/mint/v1beta1/mint.proto" \
"$COSMOS_DIR/mint/v1beta1/query.proto" \
"$COSMOS_DIR/params/v1beta1/params.proto" \
"$COSMOS_DIR/params/v1beta1/query.proto" \
"$COSMOS_DIR/slashing/v1beta1/genesis.proto" \
"$COSMOS_DIR/slashing/v1beta1/query.proto" \
"$COSMOS_DIR/slashing/v1beta1/slashing.proto" \
"$COSMOS_DIR/slashing/v1beta1/tx.proto" \
"$COSMOS_DIR/staking/v1beta1/genesis.proto" \
"$COSMOS_DIR/staking/v1beta1/query.proto" \
"$COSMOS_DIR/staking/v1beta1/staking.proto" \
"$COSMOS_DIR/staking/v1beta1/tx.proto" \
"$COSMOS_DIR/tx/signing/v1beta1/signing.proto" \
"$COSMOS_DIR/tx/v1beta1/service.proto" \
"$COSMOS_DIR/tx/v1beta1/tx.proto" \
"$COSMOS_DIR/upgrade/v1beta1/query.proto" \
"$COSMOS_DIR/upgrade/v1beta1/upgrade.proto" \
"$COSMOS_DIR/vesting/v1beta1/tx.proto" \
"$COSMOS_DIR/vesting/v1beta1/vesting.proto" \
"$IBC_DIR/applications/transfer/v1/genesis.proto" \
"$IBC_DIR/applications/transfer/v1/query.proto" \
"$IBC_DIR/applications/transfer/v1/transfer.proto" \
"$IBC_DIR/applications/transfer/v1/tx.proto" \
"$IBC_DIR/core/channel/v1/channel.proto" \
"$IBC_DIR/core/channel/v1/genesis.proto" \
"$IBC_DIR/core/channel/v1/query.proto" \
"$IBC_DIR/core/channel/v1/tx.proto" \
"$IBC_DIR/core/client/v1/client.proto" \
"$IBC_DIR/core/client/v1/genesis.proto" \
"$IBC_DIR/core/client/v1/query.proto" \
"$IBC_DIR/core/client/v1/tx.proto" \
"$IBC_DIR/lightclients/localhost/v1/localhost.proto" \
"$IBC_DIR/lightclients/solomachine/v1/solomachine.proto" \
"$IBC_DIR/lightclients/tendermint/v1/tendermint.proto" \
"$IBC_DIR/core/commitment/v1/commitment.proto" \
"$IBC_DIR/core/connection/v1/connection.proto" \
"$IBC_DIR/core/connection/v1/genesis.proto" \
"$IBC_DIR/core/connection/v1/query.proto" \
"$IBC_DIR/core/connection/v1/tx.proto" \
"$IBC_DIR/core/types/v1/genesis.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/genesis.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/ibc.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/proposal.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/query.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/tx.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/types.proto"
echo "Processing wasmd 0.18 proto files ..."
WASMD_DIR="./wasmd-0.18/proto"
WASMD_THIRD_PARTY_DIR="./wasmd-0.18/third_party/proto"
CONFIO_DIR="$WASMD_THIRD_PARTY_DIR/confio"
COSMOS_DIR="$WASMD_THIRD_PARTY_DIR/cosmos"
IBC_DIR="$WASMD_THIRD_PARTY_DIR/ibc"
protoc \
--plugin="$PLUGIN_PATH" \
--ts_proto_yarn_2_out="$OUT_DIR" \
--proto_path="$WASMD_DIR" \
--proto_path="$WASMD_THIRD_PARTY_DIR" \
--ts_proto_yarn_2_opt="esModuleInterop=true,forceLong=long,useOptionals=true" \
"$CONFIO_DIR/proofs.proto" \
"$COSMOS_DIR/auth/v1beta1/auth.proto" \
"$COSMOS_DIR/auth/v1beta1/genesis.proto" \
"$COSMOS_DIR/auth/v1beta1/query.proto" \
"$COSMOS_DIR/bank/v1beta1/bank.proto" \
"$COSMOS_DIR/bank/v1beta1/genesis.proto" \
"$COSMOS_DIR/bank/v1beta1/query.proto" \
"$COSMOS_DIR/bank/v1beta1/tx.proto" \
"$COSMOS_DIR/base/abci/v1beta1/abci.proto" \
"$COSMOS_DIR/base/kv/v1beta1/kv.proto" \
"$COSMOS_DIR/base/query/v1beta1/pagination.proto" \
"$COSMOS_DIR/base/reflection/v1beta1/reflection.proto" \
"$COSMOS_DIR/base/snapshots/v1beta1/snapshot.proto" \
"$COSMOS_DIR/base/store/v1beta1/commit_info.proto" \
"$COSMOS_DIR/base/store/v1beta1/snapshot.proto" \
"$COSMOS_DIR/base/tendermint/v1beta1/query.proto" \
"$COSMOS_DIR/base/v1beta1/coin.proto" \
"$COSMOS_DIR/capability/v1beta1/capability.proto" \
"$COSMOS_DIR/capability/v1beta1/genesis.proto" \
"$COSMOS_DIR/crisis/v1beta1/genesis.proto" \
"$COSMOS_DIR/crisis/v1beta1/tx.proto" \
"$COSMOS_DIR/crypto/ed25519/keys.proto" \
"$COSMOS_DIR/crypto/multisig/keys.proto" \
"$COSMOS_DIR/crypto/multisig/v1beta1/multisig.proto" \
"$COSMOS_DIR/crypto/secp256k1/keys.proto" \
"$COSMOS_DIR/distribution/v1beta1/distribution.proto" \
"$COSMOS_DIR/distribution/v1beta1/genesis.proto" \
"$COSMOS_DIR/distribution/v1beta1/query.proto" \
"$COSMOS_DIR/distribution/v1beta1/tx.proto" \
"$COSMOS_DIR/evidence/v1beta1/evidence.proto" \
"$COSMOS_DIR/evidence/v1beta1/genesis.proto" \
"$COSMOS_DIR/evidence/v1beta1/query.proto" \
"$COSMOS_DIR/evidence/v1beta1/tx.proto" \
"$COSMOS_DIR/genutil/v1beta1/genesis.proto" \
"$COSMOS_DIR/gov/v1beta1/genesis.proto" \
"$COSMOS_DIR/gov/v1beta1/gov.proto" \
"$COSMOS_DIR/gov/v1beta1/query.proto" \
"$COSMOS_DIR/gov/v1beta1/tx.proto" \
"$COSMOS_DIR/mint/v1beta1/genesis.proto" \
"$COSMOS_DIR/mint/v1beta1/mint.proto" \
"$COSMOS_DIR/mint/v1beta1/query.proto" \
"$COSMOS_DIR/params/v1beta1/params.proto" \
"$COSMOS_DIR/params/v1beta1/query.proto" \
"$COSMOS_DIR/slashing/v1beta1/genesis.proto" \
"$COSMOS_DIR/slashing/v1beta1/query.proto" \
"$COSMOS_DIR/slashing/v1beta1/slashing.proto" \
"$COSMOS_DIR/slashing/v1beta1/tx.proto" \
"$COSMOS_DIR/staking/v1beta1/genesis.proto" \
"$COSMOS_DIR/staking/v1beta1/query.proto" \
"$COSMOS_DIR/staking/v1beta1/staking.proto" \
"$COSMOS_DIR/staking/v1beta1/tx.proto" \
"$COSMOS_DIR/tx/signing/v1beta1/signing.proto" \
"$COSMOS_DIR/tx/v1beta1/service.proto" \
"$COSMOS_DIR/tx/v1beta1/tx.proto" \
"$COSMOS_DIR/upgrade/v1beta1/query.proto" \
"$COSMOS_DIR/upgrade/v1beta1/upgrade.proto" \
"$COSMOS_DIR/vesting/v1beta1/tx.proto" \
"$COSMOS_DIR/vesting/v1beta1/vesting.proto" \
"$IBC_DIR/applications/transfer/v1/genesis.proto" \
"$IBC_DIR/applications/transfer/v1/query.proto" \
"$IBC_DIR/applications/transfer/v1/transfer.proto" \
"$IBC_DIR/applications/transfer/v1/tx.proto" \
"$IBC_DIR/core/channel/v1/channel.proto" \
"$IBC_DIR/core/channel/v1/genesis.proto" \
"$IBC_DIR/core/channel/v1/query.proto" \
"$IBC_DIR/core/channel/v1/tx.proto" \
"$IBC_DIR/core/client/v1/client.proto" \
"$IBC_DIR/core/client/v1/genesis.proto" \
"$IBC_DIR/core/client/v1/query.proto" \
"$IBC_DIR/core/client/v1/tx.proto" \
"$IBC_DIR/lightclients/localhost/v1/localhost.proto" \
"$IBC_DIR/lightclients/solomachine/v1/solomachine.proto" \
"$IBC_DIR/lightclients/tendermint/v1/tendermint.proto" \
"$IBC_DIR/core/commitment/v1/commitment.proto" \
"$IBC_DIR/core/connection/v1/connection.proto" \
"$IBC_DIR/core/connection/v1/genesis.proto" \
"$IBC_DIR/core/connection/v1/query.proto" \
"$IBC_DIR/core/connection/v1/tx.proto" \
"$IBC_DIR/core/types/v1/genesis.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1/genesis.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1/ibc.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1/proposal.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1/query.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1/tx.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1/types.proto"