-
Notifications
You must be signed in to change notification settings - Fork 39
/
Makefile
56 lines (45 loc) · 2.5 KB
/
Makefile
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
export GOBIN := $(PWD)/bin
export PATH := $(GOBIN):$(PATH)
export GOFLAGS := -mod=mod
all: install test lint
generate:
go run ./cmd/minimock/minimock.go -i github.com/gojuno/minimock/v3.Tester -o ./tests
go run ./cmd/minimock/minimock.go -i ./tests.Formatter -o ./tests/formatter_mock.go
go run ./cmd/minimock/minimock.go -i ./tests.Formatter -o ./tests/formatter_with_custom_name_mock.go -n CustomFormatterNameMock
go run ./cmd/minimock/minimock.go -i ./tests.genericInout -o ./tests/generic_inout.go
go run ./cmd/minimock/minimock.go -i ./tests.genericOut -o ./tests/generic_out.go
go run ./cmd/minimock/minimock.go -i ./tests.genericIn -o ./tests/generic_in.go
go run ./cmd/minimock/minimock.go -i ./tests.genericSpecific -o ./tests/generic_specific.go
go run ./cmd/minimock/minimock.go -i ./tests.genericSimpleUnion -o ./tests/generic_simple_union.go
go run ./cmd/minimock/minimock.go -i ./tests.genericComplexUnion -o ./tests/generic_complex_union.go
go run ./cmd/minimock/minimock.go -i ./tests.genericInlineUnion -o ./tests/generic_inline_union.go
go run ./cmd/minimock/minimock.go -i ./tests.genericInlineUnionWithManyTypes -o ./tests/generic_inline_with_many_options.go
go run ./cmd/minimock/minimock.go -i ./tests.genericMultipleTypes -o ./tests/generic_multiple_args_with_different_types.go
go run ./cmd/minimock/minimock.go -i ./tests.contextAccepter -o ./tests/context_accepter_mock.go
go run ./cmd/minimock/minimock.go -i github.com/gojuno/minimock/v3.Tester -o ./tests/package_name_specified_test.go -p tests_test
go run ./cmd/minimock/minimock.go -i ./tests.actor -o ./tests/actor_mock.go
go run ./cmd/minimock/minimock.go -i ./tests.formatterAlias -o ./tests/formatter_alias_mock.go
go run ./cmd/minimock/minimock.go -i ./tests.formatterType -o ./tests/formatter_type_mock.go
go run ./cmd/minimock/minimock.go -i ./tests.reader -o ./tests/reader_mock.go -gr
./bin:
mkdir ./bin
lint: ./bin/golangci-lint
./bin/golangci-lint run --enable=goimports --disable=unused --exclude=S1023,"Error return value" ./tests/...
install:
go mod download
go install ./cmd/minimock
./bin/golangci-lint: ./bin
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.55.2
./bin/goreleaser: ./bin
go install -modfile tools/go.mod github.com/goreleaser/goreleaser
./bin/minimock:
go build ./cmd/minimock -o ./bin/minimock
.PHONY:
test:
go test -race ./... -v
build: ./bin/goreleaser
./bin/goreleaser build --snapshot --rm-dist
.PHONY:
tidy:
go mod tidy
cd tools && go mod tidy