Makefile
NAME := mongo-streamerBUILD_DIR := ./buildGO ?= goBIN := $(abspath ./bin) $(BIN)/wire: GOBIN=$(BIN) go install github.com/google/wire/cmd/wire@latest$(BIN)/mockgen: GOBIN=$(BIN) go install go.uber.org/mock/mockgen@latest .PHONY: buildbuild: VERSION := $(shell git describe --tags --always --dirty)build: REVISION := $(shell git rev-parse --short HEAD)build: TIMESTAMP := $(shell date -u '+%Y-%m-%d_%I:%M:%S%p')build: STAMP_PKG := github.com/ucpr/mongo-streamer/pkg/stampbuild: $(GO) build -ldflags "-X $(STAMP_PKG).BuildVersion=$(VERSION) -X $(STAMP_PKG).BuildRevision=$(REVISION) -X $(STAMP_PKG).BuildTimestamp=$(TIMESTAMP)" -o $(BUILD_DIR)/$(NAME) ./cmd .PHONY: testtest: PKG ?= ./...test: FLAGS ?=test: $(GO) test -race $(PKG) $(FLAGS) .PHONY: integration-testintegration-test: PKG ?= ./...integration-test: $(GO) test -race $(PKG) -tags=integration .PHONY: generategenerate: $(BIN)/wire $(BIN)/mockgengenerate: PKG ?= ./...generate: GOBIN=$(BIN) $(GO) generate $(PKG)