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