ADAPT_PATH = ./pkg/net
serv.build:
	clear
	go fmt ./...
	go build -o ./bin/gobus ./cmd/gobus/main.go
serv.run:
	clear
	go fmt ./...
	go build -race -o ./bin/gobus_race ./cmd/gobus/main.go
	./gobus_dev.sh
desk.run:
	clear
	go fmt ./...
	go build -o ./bin/desktop ./cmd/desktop/main.go
	./desktop.sh
mod:
	clear
	go get ./...
	go get -u ./...
	go mod tidy -compat=1.20
	go mod vendor
lint:
	clear
	go fmt ./...
	golangci-lint run ./...
	gocyclo -over 10 ./
	gocritic check ./...
	staticcheck ./...
test.run:
	clear
	go fmt ./...
	go test -vet=all -race -timeout 30s -coverprofile cover.out ./...
	go tool cover -func=cover.out
proto:
	clear
	protoc --go_out=$(ADAPT_PATH) \
	--go_opt=paths=import \
   --go-grpc_out=$(ADAPT_PATH) \
	--go-grpc_opt=paths=import \
   $(ADAPT_PATH)/gobus.proto

SERVICEURL=./
graph:
	goda graph -f "{{.Package.Name}}" "shared($(SERVICEURL)... )" | dot -Tsvg -o ./docs/graph.svg
dot:
	goda graph -f "{{.Package.Name}}" "shared($(SERVICEURL)... )" > ./docs/graph.dot