1
0

Task Attachments (#104)

This commit is contained in:
konrad
2019-10-16 20:52:29 +00:00
committed by Gitea
parent e2f481a6e5
commit 2169464983
349 changed files with 22540 additions and 5267 deletions

View File

@ -3,14 +3,16 @@ GOLINT:=$(shell which golint)
GOIMPORT:=$(shell which goimports)
GOFMT:=$(shell which gofmt)
GOBUILD:=$(GOCMD) build
GOINSTALL:=$(GOCMD) install
GOCLEAN:=$(GOCMD) clean
GOTEST:=$(GOCMD) test
GOGET:=$(GOCMD) get
GOLIST:=$(GOCMD) list
GOVET:=$(GOCMD) vet
u := $(if $(update),-u)
BINARY_NAME:=swag
PACKAGES:=$(shell $(GOLIST) ./...)
PACKAGES:=$(shell $(GOLIST) github.com/swaggo/swag github.com/swaggo/swag/cmd/swag github.com/swaggo/swag/gen)
GOFILES:=$(shell find . -name "*.go" -type f)
export GO111MODULE := on
@ -18,8 +20,12 @@ export GO111MODULE := on
all: test build
.PHONY: build
build:
$(GOBUILD) -o $(BINARY_NAME) -v ./cmd/...
build: deps
$(GOBUILD) -o $(BINARY_NAME) ./cmd/swag
.PHONY: install
install: deps
$(GOINSTALL) ./cmd/swag
.PHONY: test
test:
@ -45,18 +51,25 @@ clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
.PHONY: install
install:
$(GOGET) -v ./...
.PHONY: deps
deps:
$(GOGET) ${u} -d
$(GOGET) github.com/stretchr/testify/assert
$(GOGET) github.com/alecthomas/template
.PHONY: devel-deps
devel-deps:
GO111MODULE=off $(GOGET) -v -u \
golang.org/x/lint/golint \
github.com/swaggo/swag/cmd/swag \
github.com/swaggo/swag/gen
.PHONY: lint
lint:
which golint || $(GOGET) -u golang.org/x/lint/golint
lint: devel-deps
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
.PHONY: vet
vet:
vet: deps devel-deps
$(GOVET) $(PACKAGES)
.PHONY: fmt