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.

111 lines
2.8 KiB

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