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.

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