Scott Baker | e7144bc | 2019-10-01 14:16:47 -0700 | [diff] [blame^] | 1 | SCALA_VERSION?= 2.12 |
| 2 | KAFKA_VERSION?= 1.1.0 |
| 3 | KAFKA_DIR= kafka_$(SCALA_VERSION)-$(KAFKA_VERSION) |
| 4 | KAFKA_SRC= https://archive.apache.org/dist/kafka/$(KAFKA_VERSION)/$(KAFKA_DIR).tgz |
| 5 | KAFKA_ROOT= testdata/$(KAFKA_DIR) |
| 6 | PKG=$(shell go list ./... | grep -v vendor) |
| 7 | |
| 8 | default: vet test |
| 9 | |
| 10 | vet: |
| 11 | go vet $(PKG) |
| 12 | |
| 13 | test: testdeps |
| 14 | KAFKA_DIR=$(KAFKA_DIR) go test $(PKG) -ginkgo.slowSpecThreshold=60 |
| 15 | |
| 16 | test-verbose: testdeps |
| 17 | KAFKA_DIR=$(KAFKA_DIR) go test $(PKG) -ginkgo.slowSpecThreshold=60 -v |
| 18 | |
| 19 | test-race: testdeps |
| 20 | KAFKA_DIR=$(KAFKA_DIR) go test $(PKG) -ginkgo.slowSpecThreshold=60 -v -race |
| 21 | |
| 22 | testdeps: $(KAFKA_ROOT) |
| 23 | |
| 24 | doc: README.md |
| 25 | |
| 26 | .PHONY: test testdeps vet doc |
| 27 | |
| 28 | # --------------------------------------------------------------------- |
| 29 | |
| 30 | $(KAFKA_ROOT): |
| 31 | @mkdir -p $(dir $@) |
| 32 | cd $(dir $@) && curl -sSL $(KAFKA_SRC) | tar xz |
| 33 | |
| 34 | README.md: README.md.tpl $(wildcard *.go) |
| 35 | becca -package $(subst $(GOPATH)/src/,,$(PWD)) |