Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install mockgen #412

Merged
merged 3 commits into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions build/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const (
Osmosis Name = "osmosis"
Hermes Name = "hermes"
CoredV303 Name = "cored-v3.0.3"
Mockgen = "mockgen"
Buf Name = "buf"
Protoc Name = "protoc"
ProtocGenDoc Name = "protoc-gen-doc"
Expand Down Expand Up @@ -390,6 +391,13 @@ var tools = []Tool{
Package: "github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking",
},

// https://github.com/uber-go/mock/releases
GoPackageTool{
Name: Mockgen,
Version: "v0.4.0",
Package: "go.uber.org/mock/mockgen",
},

// https://rust-lang.github.io/rustup/installation/other.html
BinaryTool{
Name: RustUpInit,
Expand Down Expand Up @@ -1077,6 +1085,11 @@ func EnsureProtocGenBufBreaking(ctx context.Context, deps types.DepsFunc) error
return Ensure(ctx, ProtocGenBufBreaking, TargetPlatformLocal)
}

// EnsureMockgen ensures that mockgen is available.
func EnsureMockgen(ctx context.Context, deps types.DepsFunc) error {
return Ensure(ctx, Mockgen, TargetPlatformLocal)
}

func linkTool(tool Tool, platform TargetPlatform, binaries ...string) error {
for _, dst := range binaries {
relink, err := shouldRelink(tool, platform, dst)
Expand Down
Loading