forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genproto.go
75 lines (66 loc) · 1.79 KB
/
genproto.go
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
package main
import (
"context"
"os"
"github.com/gnolang/gno/tm2/pkg/amino"
"github.com/gnolang/gno/tm2/pkg/amino/genproto"
"github.com/gnolang/gno/tm2/pkg/amino/tests"
"github.com/gnolang/gno/tm2/pkg/commands"
// TODO: move these out.
"github.com/gnolang/gno/gno.land/pkg/sdk/vm"
gno "github.com/gnolang/gno/gnovm/pkg/gnolang"
abci "github.com/gnolang/gno/tm2/pkg/bft/abci/types"
"github.com/gnolang/gno/tm2/pkg/bft/blockchain"
"github.com/gnolang/gno/tm2/pkg/bft/consensus"
ctypes "github.com/gnolang/gno/tm2/pkg/bft/consensus/types"
"github.com/gnolang/gno/tm2/pkg/bft/mempool"
btypes "github.com/gnolang/gno/tm2/pkg/bft/types"
"github.com/gnolang/gno/tm2/pkg/bitarray"
"github.com/gnolang/gno/tm2/pkg/crypto/ed25519"
"github.com/gnolang/gno/tm2/pkg/crypto/hd"
"github.com/gnolang/gno/tm2/pkg/crypto/merkle"
"github.com/gnolang/gno/tm2/pkg/crypto/multisig"
"github.com/gnolang/gno/tm2/pkg/sdk"
"github.com/gnolang/gno/tm2/pkg/sdk/bank"
"github.com/gnolang/gno/tm2/pkg/std"
)
func main() {
cmd := commands.NewCommand(
commands.Metadata{
LongHelp: "Generates proto bindings for Amino packages",
},
commands.NewEmptyConfig(),
execGen,
)
cmd.Execute(context.Background(), os.Args[1:])
}
func execGen(_ context.Context, _ []string) error {
pkgs := []*amino.Package{
bitarray.Package,
merkle.Package,
abci.Package,
btypes.Package,
consensus.Package,
ctypes.Package,
mempool.Package,
ed25519.Package,
blockchain.Package,
hd.Package,
multisig.Package,
std.Package,
sdk.Package,
bank.Package,
vm.Package,
gno.Package,
tests.Package,
}
for _, pkg := range pkgs {
genproto.WriteProto3Schema(pkg)
genproto.WriteProtoBindings(pkg)
genproto.MakeProtoFolder(pkg, "proto")
}
for _, pkg := range pkgs {
genproto.RunProtoc(pkg, "proto")
}
return nil
}