mirror of
https://github.com/mgechev/revive.git
synced 2025-02-19 19:10:11 +02:00
Since 1c283837a98f60bbb58746d96cb62c024c8dec3a build info variables are defined in "github.com/mgechev/revive/cli", not "main". Fixes #666
20 lines
556 B
Makefile
20 lines
556 B
Makefile
.PHONY: test
|
|
|
|
export GO111MODULE=on
|
|
|
|
GIT_COMMIT ?= $(shell git rev-parse --verify HEAD)
|
|
GIT_VERSION ?= $(shell git describe --tags --always --dirty="-dev")
|
|
DATE ?= $(shell date -u '+%Y-%m-%d %H:%M UTC')
|
|
BUILDER ?= Makefile
|
|
VERSION_FLAGS := -X "github.com/mgechev/revive/cli.version=$(GIT_VERSION)" -X "github.com/mgechev/revive/cli.date=$(DATE)" -X "github.com/mgechev/revive/cli.commit=$(GIT_COMMIT)" -X "github.com/mgechev/revive/cli.builtBy=$(BUILDER)"
|
|
|
|
install:
|
|
@go mod vendor
|
|
|
|
build:
|
|
@go build -ldflags='$(VERSION_FLAGS)'
|
|
|
|
test:
|
|
@go test -v ./...
|
|
|