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.

107 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
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.sh requires that we run the installed cmds, must not be out of date
  31. test:
  32. @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \;
  33. @ echo "==> Running go test"
  34. @ go test $(PACKAGES)
  35. test_race:
  36. @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \;
  37. @ echo "==> Running go test --race"
  38. @go test -v -race $(PACKAGES)
  39. test_integrations:
  40. @ bash test.sh
  41. fmt:
  42. @ go fmt ./...
  43. get_deps:
  44. @ go get -d $(PACKAGES)
  45. tools:
  46. go get -u -v $(GOTOOLS)
  47. get_vendor_deps:
  48. @ go get github.com/Masterminds/glide
  49. @ glide install
  50. metalinter: tools
  51. @gometalinter --install
  52. protoc --lint_out=. types/*.proto
  53. gometalinter --vendor --deadline=600s --enable-all --disable=lll ./...
  54. metalinter_test: tools
  55. @gometalinter --install
  56. # protoc --lint_out=. types/*.proto
  57. gometalinter --vendor --deadline=600s --disable-all \
  58. --enable=maligned \
  59. --enable=deadcode \
  60. --enable=gas \
  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=dupl \
  76. #--enable=errcheck \
  77. #--enable=gocyclo \
  78. #--enable=golint \ <== comments on anything exported
  79. #--enable=gotype \
  80. #--enable=interfacer \
  81. #--enable=unparam \
  82. #--enable=vet \
  83. build-docker:
  84. docker build -t "tendermint/abci-dev" -f Dockerfile.develop .
  85. run-docker:
  86. docker run -it --rm -v "$PWD:/go/src/github.com/tendermint/abci" -w "/go/src/github.com/tendermint/abci" "tendermint/abci-dev" /bin/bash
  87. .PHONY: all build test fmt get_deps tools protoc install_protoc build-docker run-docker