-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (62 loc) · 1.44 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
SERVICENAME=telegram_loki
SERVICEURL=github.com/ManyakRus/$(SERVICENAME)
FILEMAIN=./cmd/$(SERVICENAME)/main.go
FILEAPP=./bin/$(SERVICENAME)
NEW_REPO=github.com/ManyakRus/telegram_loki
run:
clear
./make_version.sh
go build -race -o $(FILEAPP) $(FILEMAIN)
# cd ./bin && \
./bin/$(SERVICENAME)
mod:
clear
go get -u ./...
go mod tidy -compat=1.22
go mod vendor
./make_version.sh
go fmt ./...
build:
clear
./make_version.sh
go build -race -o $(FILEAPP) $(FILEMAIN)
cp $(FILEAPP) "./bin_prod/$(SERVICENAME)"
cd ./cmd && \
./VersionToFile.py
lint:
clear
./make_version.sh
go fmt ./...
golangci-lint run ./internal/...
golangci-lint run ./pkg/...
gocyclo -over 10 ./internal
gocyclo -over 10 ./pkg
gocritic check ./internal/...
gocritic check ./pkg/...
staticcheck ./internal/...
staticcheck ./pkg/...
run.test:
clear
./make_version.sh
go fmt ./...
go test -coverprofile cover.out ./internal/v0/app/...
go tool cover -func=cover.out
newrepo:
clear
./make_version.sh
sed -i 's+$(SERVICEURL)+$(NEW_REPO)+g' go.mod
find -name *.go -not -path "*/vendor/*"|xargs sed -i 's+$(SERVICEURL)+$(NEW_REPO)+g'
graph:
clear
image_packages ./ docs/packages.graphml
conn:
clear
image_connections ./internal docs/connections.graphml $(SERVICENAME)
lines:
clear
./make_version.sh
go_lines_count ./ ./docs/lines_count.txt 10
licenses:
golicense -out-xlsx=./docs/licenses.xlsx $(FILEAPP)
gocyclo:
golangci-lint run ./... --disable-all -E gocyclo -v