Skip to content

Commit

Permalink
build: bind mockery into go mod (#173)
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian authored Jan 22, 2024
1 parent 3952c34 commit 369f8b7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ require (
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
github.com/tendermint/tendermint v0.34.27
github.com/vektra/mockery/v2 v2.40.1
go.uber.org/zap v1.24.0
golang.org/x/net v0.14.0
golang.org/x/sync v0.3.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1893,6 +1893,8 @@ github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPU
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
github.com/vektra/mockery/v2 v2.14.0 h1:KZ1p5Hrn8tiY+LErRMr14HHle6khxo+JKOXLBW/yfqs=
github.com/vektra/mockery/v2 v2.14.0/go.mod h1:bnD1T8tExSgPD1ripLkDbr60JA9VtQeu12P3wgLZd7M=
github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
github.com/vmware/govmomi v0.18.0 h1:f7QxSmP7meCtoAmiKZogvVbLInT+CZx6Px6K5rYsJZo=
Expand Down
4 changes: 2 additions & 2 deletions make/init.mk
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ AKASHD_LOCAL_PATH := $(shell $(GO) list -mod=readonly -m -f '{{ .Dir
AKASHD_VERSION := $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' $(AKASHD_MODULE) | cut -c2-)
GRPC_GATEWAY_VERSION := $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/grpc-ecosystem/grpc-gateway)
GOLANGCI_LINT_VERSION ?= v1.51.2
GOLANG_VERSION ?= 1.16.1
STATIK_VERSION ?= v0.1.7
GIT_CHGLOG_VERSION ?= v0.15.1
MOCKERY_VERSION ?= 2.32.0
MOCKERY_PACKAGE_NAME := github.com/vektra/mockery/v2
MOCKERY_VERSION ?= $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' $(MOCKERY_PACKAGE_NAME))
K8S_CODE_GEN_VERSION ?= $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' k8s.io/code-generator)

AKASHD_BUILD_FROM_SRC := false
Expand Down
2 changes: 1 addition & 1 deletion make/setup-cache.mk
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ $(GIT_CHGLOG): $(GIT_CHGLOG_VERSION_FILE)
$(MOCKERY_VERSION_FILE): $(AP_DEVCACHE)
@echo "installing mockery $(MOCKERY_VERSION) ..."
rm -f $(MOCKERY)
GOBIN=$(AP_DEVCACHE_BIN) go install -ldflags '-s -w -X github.com/vektra/mockery/v2/pkg/config.SemVer=$(MOCKERY_VERSION)' github.com/vektra/mockery/v2@v$(MOCKERY_VERSION)
GOBIN=$(AP_DEVCACHE_BIN) go install -ldflags '-s -w -X $(MOCKERY_PACKAGE_NAME)/pkg/config.SemVer=$(MOCKERY_VERSION)' $(MOCKERY_PACKAGE_NAME)@$(MOCKERY_VERSION)
rm -rf "$(dir $@)"
mkdir -p "$(dir $@)"
touch $@
Expand Down
1 change: 1 addition & 0 deletions tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package tools

// nolint
import (
_ "github.com/vektra/mockery/v2"
_ "k8s.io/code-generator"
_ "sigs.k8s.io/kind"
)

0 comments on commit 369f8b7

Please sign in to comment.