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.

101 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
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: install
  32. @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \;
  33. @ echo "==> Running unit tests"
  34. @ go test $(PACKAGES)
  35. @ echo "==> Running integration tests (./tests)"
  36. @ bash tests/test.sh
  37. fmt:
  38. @ go fmt ./...
  39. get_deps:
  40. @ go get -d $(PACKAGES)
  41. tools:
  42. go get -u -v $(GOTOOLS)
  43. get_vendor_deps:
  44. @ go get github.com/Masterminds/glide
  45. @ glide install
  46. metalinter: tools
  47. @gometalinter --install
  48. protoc --lint_out=. types/*.proto
  49. gometalinter --vendor --deadline=600s --enable-all --disable=lll ./...
  50. metalinter_test: tools
  51. @gometalinter --install
  52. # protoc --lint_out=. types/*.proto
  53. gometalinter --vendor --deadline=600s --disable-all \
  54. --enable=maligned \
  55. --enable=deadcode \
  56. --enable=gas \
  57. --enable=goconst \
  58. --enable=goimports \
  59. --enable=gosimple \
  60. --enable=ineffassign \
  61. --enable=megacheck \
  62. --enable=misspell \
  63. --enable=staticcheck \
  64. --enable=safesql \
  65. --enable=structcheck \
  66. --enable=unconvert \
  67. --enable=unused \
  68. --enable=varcheck \
  69. --enable=vetshadow \
  70. ./...
  71. #--enable=dupl \
  72. #--enable=errcheck \
  73. #--enable=gocyclo \
  74. #--enable=golint \ <== comments on anything exported
  75. #--enable=gotype \
  76. #--enable=interfacer \
  77. #--enable=unparam \
  78. #--enable=vet \
  79. build-docker:
  80. docker build -t "tendermint/abci-dev" -f Dockerfile.develop .
  81. run-docker:
  82. docker run -it --rm -v "$PWD:/go/src/github.com/tendermint/abci" -w "/go/src/github.com/tendermint/abci" "tendermint/abci-dev" /bin/bash
  83. .PHONY: all build test fmt get_deps tools protoc install_protoc build-docker run-docker