Skip to content

Commit

Permalink
feat(operator): add mockgen cmd to makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
moomman committed Jun 8, 2023
1 parent 9a7b47f commit 3604a24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions shardingsphere-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
CHECK_LINT?= $(LOCALBIN)/golangci-lint
CHECK_MOCKGEN ?= $(LOCALBIN)/mockgen

## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.7
Expand Down Expand Up @@ -145,3 +146,12 @@ lint: check-lint
check-lint: $(CHECK_LINT) ## Download golangci-lint-setup locally if necessary.
$(CHECK_LINT): $(LOCALBIN)
GOBIN=$(LOCALBIN) CGO_ENABLED=0 go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

.PHONY: mockgen
mockgen: check-mockgen
GOBIN=$(LOCALBIN) mockgen -package mockChaos -destination pkg/kubernetes/chaosmesh/mocks/store.go github.com/apache/shardingsphere-on-cloud/shardingsphere-operator/pkg/kubernetes/chaosmesh Chaos

.PHONY: check-mockgen
check-mockgen: $(CHECK_MOCKGEN)
$(CHECK_MOCKGEN): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install github.com/golang/mock/mockgen@v1.6.0

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3604a24

Please sign in to comment.