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

add Makefile

parent 4618a47e
No related branches found
No related tags found
No related merge requests found
Makefile 0 → 100644
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
VERSION ?= latest
GO = go
GO_PATH = $$($(GO) env GOPATH)
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
PLATFORMS := windows linux darwin
os = $(word 1, $@)
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
.PHONE: test
test: clean lint
$(GO_TEST) ./... -coverprofile=coverage.txt -covermode=atomic
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` ]]
.PHONY: verify
verify: clean license lint test
.PHONY: clean
clean: tools
-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