Skip to content
Snippets Groups Projects
Commit 9d343fb7 authored by 邹毅贤's avatar 邹毅贤
Browse files

add makefiel and ignore

parent a6dd23f9
No related branches found
No related tags found
No related merge requests found
...@@ -36,3 +36,5 @@ config_center/apollo/mockDubbog.properties.json ...@@ -36,3 +36,5 @@ config_center/apollo/mockDubbog.properties.json
# vim stuff # vim stuff
*~ *~
.*.sw? .*.sw?
/license-header-checker-linux/
/license-header-checker-linux.zip
...@@ -19,6 +19,7 @@ VERSION ?= latest ...@@ -19,6 +19,7 @@ VERSION ?= latest
GO = go GO = go
GO_PATH = $$($(GO) env GOPATH) GO_PATH = $$($(GO) env GOPATH)
GO_OS = $$($(GO) env GOOS)
GO_BUILD = $(GO) build GO_BUILD = $(GO) build
GO_GET = $(GO) get GO_GET = $(GO) get
GO_TEST = $(GO) test GO_TEST = $(GO) test
...@@ -26,7 +27,8 @@ GO_BUILD_FLAGS = -v ...@@ -26,7 +27,8 @@ GO_BUILD_FLAGS = -v
GO_BUILD_LDFLAGS = -X main.version=$(VERSION) GO_BUILD_LDFLAGS = -X main.version=$(VERSION)
GO_LICENSE_CHECKER = $(GO_PATH)/bin/license-header-checker GO_LICENSE_CHECKER = $(GO_PATH)/bin/license-header-checker
LICENSE_DIR = /tmp/tools/license GO_LICENSE_CHECKER_DIR = license-header-checker-$(GO_OS)
LICENSE_DIR = /tmp/tools/license/license.txt
PLATFORMS := windows linux darwin PLATFORMS := windows linux darwin
os = $(word 1, $@) os = $(word 1, $@)
...@@ -35,9 +37,11 @@ ARCH = amd64 ...@@ -35,9 +37,11 @@ ARCH = amd64
SHELL = /bin/bash SHELL = /bin/bash
prepare: prepare:
$(GO_LICENSE_CHECKER) -version || GO111MODULE=off $(GO_GET) -u github.com/lsm-dev/license-header-checker wget https://github.com/lsm-dev/license-header-checker/releases/download/v1.1.0/$(GO_LICENSE_CHECKER_DIR).zip -O $(GO_LICENSE_CHECKER_DIR).zip
wget -P $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt unzip -o $(GO_LICENSE_CHECKER_DIR).zip
./before_ut.sh cp $(GO_LICENSE_CHECKER_DIR)/64bits/license-header-checker $(GO_PATH)/bin/
wget -O $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt
#./before_ut.sh
.PHONE: test .PHONE: test
test: clean lint test: clean lint
...@@ -47,12 +51,12 @@ deps: prepare ...@@ -47,12 +51,12 @@ deps: prepare
$(GO_GET) -v -t -d ./... $(GO_GET) -v -t -d ./...
.PHONY: license .PHONY: license
license: clean tools license: clean prepare
$(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR)/license.txt . go && [[ -z `git status -s` ]] $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR) . go && [[ -z `git status -s` ]]
.PHONY: verify .PHONY: verify
verify: clean license lint test verify: clean license lint test
.PHONY: clean .PHONY: clean
clean: tools clean: prepare
-rm -rf coverage.txt -rm -rf coverage.txt
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment