Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ftr:Change verify to Makefile #831

Merged
merged 12 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add makefiel and ignore
  • Loading branch information
zouyx committed Nov 3, 2020
commit 9d343fb71046d979d473b8045099260187faafbd
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ config_center/apollo/mockDubbog.properties.json
# vim stuff
*~
.*.sw?
/license-header-checker-linux/
/license-header-checker-linux.zip
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ VERSION ?= latest

GO = go
GO_PATH = $$($(GO) env GOPATH)
GO_OS = $$($(GO) env GOOS)
GO_BUILD = $(GO) build
GO_GET = $(GO) get
GO_TEST = $(GO) test
GO_BUILD_FLAGS = -v
GO_BUILD_LDFLAGS = -X main.version=$(VERSION)

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
os = $(word 1, $@)
Expand All @@ -35,9 +37,11 @@ ARCH = amd64
SHELL = /bin/bash

prepare:
$(GO_LICENSE_CHECKER) -version || GO111MODULE=off $(GO_GET) -u github.com/lsm-dev/license-header-checker
wget -P $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt
./before_ut.sh
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
unzip -o $(GO_LICENSE_CHECKER_DIR).zip
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
test: clean lint
Expand All @@ -47,12 +51,12 @@ deps: prepare
$(GO_GET) -v -t -d ./...

.PHONY: license
license: clean tools
$(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR)/license.txt . go && [[ -z `git status -s` ]]
license: clean prepare
$(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR) . go && [[ -z `git status -s` ]]

.PHONY: verify
verify: clean license lint test

.PHONY: clean
clean: tools
clean: prepare
-rm -rf coverage.txt