forked from vmware-archive/legacy-terraform-provider-vra7
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (33 loc) · 968 Bytes
/
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
VERSION=0.0.1
NAME=terraform-provider-vra7
SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
.PHONY: all build check clean dev fmt simplify race release
all: check build
build:
for os in darwin linux windows; do \
GOARCH=amd64 GOOS=$$os go build -o ${NAME}-$$os; \
done
check:
@test -z $(shell gofmt -l ${SRC} | tee /dev/stderr) || echo "Fix formatting issues with 'make fmt'"
@gofmt -d ${SRC}
@for d in $$(go list ./... | grep -v /vendor/); do golint $${d}; done
@go tool vet main.go
@go tool vet vrealize
go test ./...
clean:
rm -rf pkg
rm terraform-provider-vra7*
dev:
GOARCH=$$(go env GOARCH) GOOS=$$(go env GOOS) go install
fmt:
@gofmt -l -w $(SRC)
simplify:
@gofmt -s -l -w $(SRC)
race:
go test -race ./...
release:
for os in darwin linux windows; do \
mkdir -p pkg/$$os; \
GOARCH=amd64 GOOS=$$os go build -o pkg/$$os/${NAME}; \
(cd pkg/$$os; zip ../../${NAME}_${VERSION}_$${os}_amd64.zip ${NAME}); \
done