generated from dnnrly/goclitem
-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
89 lines (62 loc) · 1.76 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
GO111MODULE=on
CURL_BIN ?= curl
GO_BIN ?= go
GORELEASER_BIN ?= goreleaser
PUBLISH_PARAM?=
GO_MOD_PARAM?=-mod vendor
TMP_DIR?=./tmp
BASE_DIR=$(shell pwd)
NAME=httpref
export GO111MODULE=on
export GOPROXY=https://proxy.golang.org
export PATH := $(BASE_DIR)/bin:$(PATH)
.PHONY: install deps clean clean-deps test-deps build-deps deps test acceptance-test ci-test lint release update
install:
$(GO_BIN) install -v ./cmd/$(NAME)
clean:
rm -f ./bin/$(NAME)
rm -rf dist/
rm -rf cmd/$(NAME)/dist
clean-deps:
rm -rf ./bin
rm -rf ./tmp
rm -rf ./libexec
rm -rf ./share
./bin/httpref:
$(GO_BIN) build -o ./bin/$(NAME) -v ./cmd/$(NAME)
build: ./bin/httpref
./bin/godog:
GOBIN=$(BASE_DIR)/bin go install github.com/cucumber/godog/cmd/[email protected]
./bin/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.42.1
./bin/tparse: ./bin ./tmp
GOBIN=$(BASE_DIR)/bin go install github.com/mfridman/[email protected]
test-deps: ./bin/tparse ./bin/godog ./bin/golangci-lint
$(GO_BIN) get -v ./...
$(GO_BIN) mod tidy
./bin:
mkdir ./bin
./tmp:
mkdir ./tmp
./bin/goreleaser: ./bin ./tmp
$(CURL_BIN) --fail -L -o ./tmp/goreleaser.tar.gz https://github.com/goreleaser/goreleaser/releases/download/v0.117.2/goreleaser_Linux_x86_64.tar.gz
gunzip -f ./tmp/goreleaser.tar.gz
tar -C ./bin -xvf ./tmp/goreleaser.tar
build-deps: ./bin/goreleaser
deps: build-deps test-deps
test: ./bin/tparse
$(GO_BIN) test -json ./... | tparse -all
acceptance-test:
cd test; godog
ci-test:
$(GO_BIN) test -race -coverprofile=coverage.txt -covermode=atomic ./...
lint:
golangci-lint run
release: clean
cd cmd/$(NAME) ; $(GORELEASER_BIN) $(PUBLISH_PARAM)
update:
$(GO_BIN) get -u
$(GO_BIN) mod tidy
make test
make install
$(GO_BIN) mod tidy