forked from alibaba/terraform-provider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (38 loc) · 1.48 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
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
VETARGS?=-all
TEST?=$$(go list ./...)
all: build
build: mac windows linux
dev: clean fmt mac copy
copy:
tar -xvf bin/terraform-provider-alicloud_darwin-amd64.tgz && mv bin/terraform-provider-alicloud $(shell dirname `which terraform`)
test: vet fmtcheck errcheck
TF_ACC=1 go test -v ./alicloud -run=TestAccAlicloud -timeout=180m -parallel=4
vet:
@echo "go tool vet $(VETARGS) ."
@go tool vet $(VETARGS) $$(ls -d */ | grep -v vendor) ; if [ $$? -eq 1 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi
fmt:
gofmt -w $(GOFMT_FILES)
fmtcheck:
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
errcheck:
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"
clean:
rm -rf bin/*
mac:
GOOS=darwin GOARCH=amd64 go build -o bin/terraform-provider-alicloud
tar czvf bin/terraform-provider-alicloud_darwin-amd64.tgz bin/terraform-provider-alicloud
rm -rf bin/terraform-provider-alicloud
windows:
GOOS=windows GOARCH=amd64 go build -o bin/terraform-provider-alicloud.exe
tar czvf bin/terraform-provider-alicloud_windows-amd64.tgz bin/terraform-provider-alicloud.exe
rm -rf bin/terraform-provider-alicloud.exe
linux:
GOOS=linux GOARCH=amd64 go build -o bin/terraform-provider-alicloud
tar czvf bin/terraform-provider-alicloud_linux-amd64.tgz bin/terraform-provider-alicloud
rm -rf bin/terraform-provider-alicloud