From 9bac43b26dd6321026702e0a17de0addd99d2352 Mon Sep 17 00:00:00 2001 From: Boris Evseev Date: Tue, 21 Sep 2021 14:15:25 +0300 Subject: [PATCH] tweak makefile --- Makefile | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 790dced..7b1aa48 100644 --- a/Makefile +++ b/Makefile @@ -15,19 +15,17 @@ generate: ./bin: mkdir ./bin -./bin/golangci-lint: ./bin - go get github.com/golangci/golangci-lint/cmd/golangci-lint - -./bin/goreleaser: - go install github.com/goreleaser/goreleaser - -lint: ./bin/golangci-lint +lint: install-tools ./bin/golangci-lint run --enable=goimports --disable=unused --exclude=S1023,"Error return value" ./tests/... install: go mod download go install ./cmd/minimock +# iterate over requirements from tools/tools.go and install them to ./bin +install-tools: ./bin + @cd tools && go list -f '{{range .Imports}}{{.}} {{end}}' tools.go | xargs go install + clean: [ -e ./tests/formatter_mock.go.test_origin ] && mv -f ./tests/formatter_mock.go.test_origin ./tests/formatter_mock.go [ -e ./tests/tester_mock_test.go.test_origin ] && mv -f ./tests/tester_mock_test.go.test_origin ./tests/tester_mock_test.go @@ -42,8 +40,8 @@ test: test_save_origin generate diff ./tests/tester_mock_test.go ./tests/tester_mock_test.go.test_origin go test -race ./... -release: ./bin/goreleaser - goreleaser release +release: install-tools + ./bin/goreleaser release -build: ./bin/goreleaser - goreleaser build --snapshot --rm-dist +build: install-tools + ./bin/goreleaser build --snapshot --rm-dist