mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-12-24 04:15:08 -07:00
6d708b2807
* Create asdf-version script to print formatted version * Update Makefile to set main.version variable during build * Improve help output formatting * Update release-build workflow to set asdf version in binaries
40 lines
720 B
Makefile
40 lines
720 B
Makefile
MAIN_PACKAGE_PATH := .
|
|
TARGET_DIR := .
|
|
TARGET := asdf
|
|
FULL_VERSION = $(shell ./scripts/asdf-version )
|
|
LINKER_FLAGS = '-s -X main.version=${FULL_VERSION}'
|
|
|
|
# Not sure what the default location should be for builds
|
|
build: # test lint
|
|
go build -ldflags=${LINKER_FLAGS} -o=${TARGET_DIR}/${TARGET} ${MAIN_PACKAGE_PATH}
|
|
|
|
fmt:
|
|
go fmt ./...
|
|
gofumpt -l -w .
|
|
|
|
verify:
|
|
go mod verify
|
|
|
|
tidy:
|
|
go mod tidy -v
|
|
|
|
audit: verify vet test
|
|
|
|
test:
|
|
go test -coverprofile=/tmp/coverage.out -bench= -race ./...
|
|
|
|
cover: test
|
|
go tool cover -html=/tmp/coverage.out
|
|
|
|
lint: fmt
|
|
staticcheck -tests -show-ignored ./...
|
|
revive -set_exit_status ./...
|
|
|
|
vet: fmt
|
|
go vet .
|
|
|
|
run: build
|
|
${TARGET_DIR}/${TARGET}
|
|
|
|
.PHONY: fmt lint vet build test run
|