generate:
	rm -rf proto
	mkdir -p proto

	protoc -I ./api \
      --go_out ./proto --go_opt paths=source_relative \
      --go-grpc_out ./proto --go-grpc_opt paths=source_relative \
      --grpc-gateway_out ./proto --grpc-gateway_opt paths=source_relative,generate_unbound_methods=true \
      --openapiv2_out=./cmd/evening_detective_server --openapiv2_opt allow_merge=true,merge_file_name=main \
      ./api/main.proto

run:
	go run ./cmd/evening_detective_server/main.go

build-builder:
	docker build -f Dockerfile.builder -t my-go-builder .

build-linux:
	docker run --rm \
		-v "$$PWD":/app \
		-w /app \
		my-go-builder sh -c \
		"GOOS=linux GOARCH=arm64 go build -o bin/evening_detective_server cmd/evening_detective_server/main.go"

test:
	go test -count=1 ./...
