You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.7 KiB

9 years ago
8 years ago
7 years ago
7 years ago
7 years ago
9 years ago
8 years ago
9 years ago
7 years ago
7 years ago
7 years ago
9 years ago
8 years ago
7 years ago
  1. GOTOOLS = \
  2. github.com/mitchellh/gox \
  3. github.com/Masterminds/glide \
  4. github.com/alecthomas/gometalinter \
  5. github.com/ckaznocha/protoc-gen-lint \
  6. github.com/gogo/protobuf/protoc-gen-gogo \
  7. github.com/gogo/protobuf/gogoproto
  8. all: install test
  9. PACKAGES=$(shell go list ./... | grep -v '/vendor/')
  10. install_protoc:
  11. # https://github.com/google/protobuf/releases
  12. curl -L https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz | tar xvz && \
  13. cd protobuf-3.4.1 && \
  14. DIST_LANG=cpp ./configure && \
  15. make && \
  16. make install && \
  17. cd .. && \
  18. rm -rf protobuf-3.4.1
  19. protoc:
  20. ## On "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory"
  21. ## ldconfig (may require sudo)
  22. ## https://stackoverflow.com/a/25518702
  23. protoc -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf --gogo_out=plugins=grpc:. types/*.proto
  24. install:
  25. @ go install ./cmd/...
  26. build:
  27. @ go build -i ./cmd/...
  28. dist:
  29. @ bash scripts/dist.sh
  30. @ bash scripts/publish.sh
  31. test:
  32. @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \;
  33. @ echo "==> Running linter"
  34. @ make metalinter_test
  35. @ echo "==> Running go test"
  36. @ go test $(PACKAGES)
  37. test_race:
  38. @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \;
  39. @ echo "==> Running go test --race"
  40. @go test -v -race $(PACKAGES)
  41. test_integrations:
  42. @ bash test.sh
  43. fmt:
  44. @ go fmt ./...
  45. get_deps:
  46. @ go get -d $(PACKAGES)
  47. ensure_tools:
  48. go get -u -v $(GOTOOLS)
  49. @gometalinter --install
  50. get_vendor_deps: ensure_tools
  51. @rm -rf vendor/
  52. @echo "--> Running glide install"
  53. @ glide install
  54. metalinter:
  55. protoc --lint_out=. types/*.proto
  56. gometalinter --vendor --deadline=600s --enable-all --disable=lll ./...
  57. metalinter_test:
  58. # protoc --lint_out=. types/*.proto
  59. gometalinter --vendor --deadline=600s --disable-all \
  60. --enable=maligned \
  61. --enable=deadcode \
  62. --enable=goconst \
  63. --enable=goimports \
  64. --enable=gosimple \
  65. --enable=ineffassign \
  66. --enable=megacheck \
  67. --enable=misspell \
  68. --enable=staticcheck \
  69. --enable=safesql \
  70. --enable=structcheck \
  71. --enable=unconvert \
  72. --enable=unused \
  73. --enable=varcheck \
  74. --enable=vetshadow \
  75. ./...
  76. #--enable=gas \
  77. #--enable=dupl \
  78. #--enable=errcheck \
  79. #--enable=gocyclo \
  80. #--enable=golint \ <== comments on anything exported
  81. #--enable=gotype \
  82. #--enable=interfacer \
  83. #--enable=unparam \
  84. #--enable=vet \
  85. build-docker:
  86. docker build -t "tendermint/abci-dev" -f Dockerfile.develop .
  87. run-docker:
  88. docker run -it --rm -v "$PWD:/go/src/github.com/tendermint/abci" -w "/go/src/github.com/tendermint/abci" "tendermint/abci-dev" /bin/bash
  89. .PHONY: all build test fmt get_deps ensure_tools protoc install_protoc build-docker run-docker