-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (35 loc) · 913 Bytes
/
Makefile
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
45
46
47
export GO111MODULE=on
export GOFLAGS=-mod=vendor
.PHONY: build
build: cmd/gptcli
cmd/gptcli: vendor FORCE
CGO_ENABLED=0 go build -o gptcli cmd/gptcli/*.go
vendor: go.mod
go mod download
go mod vendor
cmd/gptcli/version.txt:
git describe --tags > cmd/gptcli/version.txt
truncate -s -1 cmd/gptcli/version.txt
.PHONY: mocks
mocks:
cd internal; go generate
TESTPKGS=github.com/mikeb26/gptcli/cmd/gptcli
.PHONY: test
test: mocks
go test $(TESTPKGS)
unit-tests.xml: mocks FORCE
gotestsum --junitfile unit-tests.xml $(TESTPKGS)
.PHONY: lint
lint:
golangci-lint run ./...
.PHONY: clean
clean:
rm -f gptcli unit-tests.xml internal/openai_client_mock.go
.PHONY: deps
deps:
rm -rf go.mod go.sum vendor
go mod init github.com/mikeb26/gptcli
go mod edit -replace=github.com/sashabaranov/go-openai=github.com/mikeb26/[email protected]
GOPROXY=direct go mod tidy
go mod vendor
FORCE: