go-sdk/Makefile

46 строки
994 B
Makefile
Исходник Обычный вид История

2016-11-10 22:04:49 +03:00
IMPORT := code.gitea.io/sdk
2016-11-07 15:41:57 +03:00
2017-08-22 20:20:39 +03:00
PACKAGES ?= $(shell go list -e ./... | grep -v /vendor/ | grep -v /benchmark/)
2016-11-10 22:04:49 +03:00
GENERATE ?= code.gitea.io/sdk/gitea
2016-11-07 15:41:57 +03:00
.PHONY: all
all: clean test build
.PHONY: clean
clean:
go clean -i ./...
generate:
@which mockery > /dev/null; if [ $$? -ne 0 ]; then \
go get -u github.com/vektra/mockery/...; \
fi
go generate $(GENERATE)
.PHONY: fmt
fmt:
2017-08-22 20:20:39 +03:00
find . -name "*.go" -type f ! -path "./vendor/*" ! -path "./benchmark/*" | xargs gofmt -s -w
2016-11-07 15:41:57 +03:00
.PHONY: vet
vet:
go get code.gitea.io/gitea/modules/structs
2016-11-07 15:41:57 +03:00
go vet $(PACKAGES)
.PHONY: lint
lint:
@which golint > /dev/null; if [ $$? -ne 0 ]; then \
2018-10-18 05:15:43 +03:00
go get -u golang.org/x/lint/golint; \
2016-11-07 15:41:57 +03:00
fi
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
.PHONY: test
test:
for PKG in $(PACKAGES); do go test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
2017-08-22 20:20:39 +03:00
.PHONY: bench
bench:
go test -run=XXXXXX -benchtime=10s -bench=. || exit 1
2016-11-07 15:41:57 +03:00
.PHONY: build
build:
go build ./gitea