Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
guiferpa committed Oct 7, 2018
1 parent 5c280af commit c590008
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ PACKAGES=$(shell go list ./...)

KOALA=$(BIN_DIR)/$(BIN)
GOMETALINTER=$(BIN_DIR)/gometalinter
GORELEASER=$(BIN_DIR)/goreleaser
DEP=$(BIN_DIR)/dep

.PHONY: all test lint cover clean

Expand All @@ -12,24 +14,36 @@ all: clean test install
install: $(KOALA)

$(KOALA):
@go build -v -o $(KOALA) ./cmd/$(BIN)
go build -v -o $(KOALA) ./cmd/$(BIN)

test: lint
$(shell echo "mode: count" > coverage-all.out)
@for pkg in $(PACKAGES); do \
for pkg in $(PACKAGES); do \
go test -cover -coverprofile=coverage.out -covermode=count $$pkg; \
tail -n +2 coverage.out >> ./coverage-all.out; \
done

lint: $(GOMETALINTER)
@gometalinter ./...
gometalinter ./...

$(GOMETALINTER):
@go get -v -u github.com/alecthomas/gometalinter
go get -v -u github.com/alecthomas/gometalinter

$(GORELEASER): $(DEP)
go get -d github.com/goreleaser/goreleaser
cd $(GOPATH)/src/github.com/goreleaser/goreleaser \
&& dep ensure -vendor-only \
&& go install

$(DEP):
go get -v -u github.com/golang/dep/cmd/dep

release: $(GORELEASER)
goreleaser

cover: test
@go tool cover -html=coverage-all.out
@rm -rf coverage-all.out coverage.out
go tool cover -html=coverage-all.out
rm -rf coverage-all.out coverage.out

clean:
@rm -rf $(KOALA)
rm -rf $(KOALA)

0 comments on commit c590008

Please sign in to comment.