2023-09-28 16:45:44 +02:00
|
|
|
SERVICENAME=crud_generator
|
|
|
|
SERVICEURL=github.com/ManyakRus/$(SERVICENAME)
|
|
|
|
|
2023-11-15 16:59:21 +02:00
|
|
|
FILEMAIN=./cmd/$(SERVICENAME)/main.go
|
2023-09-28 16:45:44 +02:00
|
|
|
FILEAPP=./bin/$(SERVICENAME)
|
|
|
|
|
|
|
|
NEW_REPO=$(SERVICENAME)
|
|
|
|
|
|
|
|
|
|
|
|
run:
|
|
|
|
clear
|
|
|
|
go build -race -o $(FILEAPP) $(FILEMAIN)
|
|
|
|
# cd ./bin && \
|
2023-11-15 16:59:21 +02:00
|
|
|
./bin/$(SERVICENAME)
|
2023-09-28 16:45:44 +02:00
|
|
|
mod:
|
|
|
|
clear
|
2024-03-06 15:03:41 +02:00
|
|
|
go get -u ./cmd/crud_generator/... ./internal/... ./pkg/...
|
2023-09-28 16:45:44 +02:00
|
|
|
go mod tidy -compat=1.18
|
|
|
|
go mod vendor
|
|
|
|
go fmt ./...
|
|
|
|
build:
|
|
|
|
clear
|
|
|
|
go build -race -o $(FILEAPP) $(FILEMAIN)
|
2023-11-15 16:59:21 +02:00
|
|
|
cd ./scripts && \
|
2023-09-28 16:45:44 +02:00
|
|
|
./VersionToFile.py
|
|
|
|
|
|
|
|
lint:
|
|
|
|
clear
|
|
|
|
go fmt ./...
|
2023-10-23 17:09:55 +02:00
|
|
|
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/...
|
2023-09-28 16:45:44 +02:00
|
|
|
run.test:
|
|
|
|
clear
|
|
|
|
go fmt ./...
|
|
|
|
go test -coverprofile cover.out ./internal/v0/app/...
|
|
|
|
go tool cover -func=cover.out
|
|
|
|
newrepo:
|
|
|
|
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)
|