tendermint/Makefile

89 lines
2.0 KiB
Makefile
Raw Normal View History

2017-06-01 20:32:55 -07:00
GOTOOLS = \
github.com/mitchellh/gox \
github.com/Masterminds/glide \
github.com/alecthomas/gometalinter
2015-12-17 13:46:04 -08:00
all: protoc install test
2016-01-30 19:36:33 -08:00
2017-01-12 12:47:55 -08:00
NOVENDOR = go list github.com/tendermint/abci/... | grep -v /vendor/
2016-11-09 17:12:29 -08:00
2017-01-10 06:59:29 -08:00
install-protoc:
# Download: https://github.com/google/protobuf/releases
go get github.com/golang/protobuf/protoc-gen-go
2016-01-30 19:36:33 -08:00
protoc:
2017-01-16 21:58:42 -08:00
@ protoc --go_out=plugins=grpc:. types/*.proto
2015-12-17 13:46:04 -08:00
2016-11-09 17:12:29 -08:00
install:
2017-01-16 21:58:42 -08:00
@ go install github.com/tendermint/abci/cmd/...
2015-12-17 13:46:04 -08:00
2017-01-16 22:33:48 -08:00
build:
@ go build -i github.com/tendermint/abci/cmd/...
2017-06-01 20:32:55 -07:00
dist:
2017-06-02 09:44:00 -07:00
@ bash scripts/dist.sh
2017-06-01 20:32:55 -07:00
@ bash scripts/publish.sh
2017-01-12 03:37:47 -08:00
# test.sh requires that we run the installed cmds, must not be out of date
test: install
2017-05-04 12:24:58 -07:00
find . -path ./vendor -prune -o -name *.sock -exec rm {} \;
2017-01-27 22:27:32 -08:00
@ go test -p 1 `${NOVENDOR}`
2017-01-16 21:58:42 -08:00
@ bash tests/test.sh
fmt:
@ go fmt ./...
lint:
@ go get -u github.com/golang/lint/golint
@ for file in $$(find "." -name '*.go' | grep -v '/vendor/' | grep -v '\.pb\.go'); do \
golint -set_exit_status $${file}; \
done;
2015-12-17 13:46:04 -08:00
2016-11-09 17:12:29 -08:00
test_integrations: get_vendor_deps install test
2015-12-17 13:46:04 -08:00
get_deps:
2017-01-16 21:58:42 -08:00
@ go get -d `${NOVENDOR}`
2016-11-09 17:12:29 -08:00
2017-06-01 20:32:55 -07:00
tools:
go get -u -v $(GOTOOLS)
2016-11-09 17:12:29 -08:00
get_vendor_deps:
2017-01-16 21:58:42 -08:00
@ go get github.com/Masterminds/glide
@ glide install
2017-06-01 20:32:55 -07:00
metalinter: tools
@gometalinter --install
gometalinter --vendor --deadline=600s --enable-all --disable=lll ./...
metalinter_test: tools
@gometalinter --install
gometalinter --vendor --deadline=600s --disable-all \
2017-09-21 12:32:06 -07:00
--enable=aligncheck \
--enable=deadcode \
--enable=gas \
--enable=goimports \
--enable=gosimple \
--enable=gotype \
--enable=ineffassign \
--enable=misspell \
--enable=safesql \
--enable=structcheck \
--enable=varcheck \
./...
#--enable=dupl \
#--enable=errcheck \
#--enable=goconst \
#--enable=gocyclo \
#--enable=golint \ <== comments on anything exported
#--enable=interfacer \
#--enable=megacheck \
#--enable=staticcheck \
#--enable=unconvert \
#--enable=unparam \
#--enable=unused \
#--enable=vet \
#--enable=vetshadow \
2017-06-01 20:32:55 -07:00
.PHONY: all build test fmt lint get_deps tools