-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (31 loc) · 1.06 KB
/
Makefile
File metadata and controls
44 lines (31 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
.PHONY: build test clean install lint tidy deps all test-cover fmt verify
BINARY_NAME=sfdc
VERSION?=$(shell cat version.txt 2>/dev/null || echo "dev")
COMMIT?=$(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
BUILD_DATE?=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS=-ldflags "-X github.com/open-cli-collective/salesforce-cli/internal/version.Version=$(VERSION) \
-X github.com/open-cli-collective/salesforce-cli/internal/version.Commit=$(COMMIT) \
-X github.com/open-cli-collective/salesforce-cli/internal/version.BuildDate=$(BUILD_DATE)"
build:
go build $(LDFLAGS) -o bin/$(BINARY_NAME) ./cmd/sfdc
test:
go test -race -v ./...
test-cover:
go test -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
clean:
rm -rf bin/
rm -f coverage.out coverage.html
install: build
cp bin/$(BINARY_NAME) /usr/local/bin/
lint:
golangci-lint run
tidy:
go mod tidy
deps:
go mod download
fmt:
go fmt ./...
goimports -w -local github.com/open-cli-collective/salesforce-cli .
verify: fmt lint test
all: tidy lint test build