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
  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. all: install test
  7. PACKAGES=$(shell go list ./... | grep -v '/vendor/')
  8. install_protoc:
  9. # https://github.com/google/protobuf/releases
  10. curl -L https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz | tar xvz && \
  11. cd protobuf-3.4.1 && \
  12. DIST_LANG=cpp ./configure && \
  13. make && \
  14. make install && \
  15. cd .. && \
  16. rm -rf protobuf-3.4.1
  17. go get github.com/golang/protobuf/protoc-gen-go
  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 --go_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=gas \
  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=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