move to buf

This commit is contained in:
2025-07-20 11:13:38 -04:00
parent d875bbb2f7
commit 55497b9d2a
13 changed files with 349 additions and 632 deletions

View File

@ -12,15 +12,9 @@ GIT_REPO := gitea.libretechconsulting.com/rmcguire/go-server-with-otel
all: proto test build docker
proto: check_protoc $(API_DIR)
protoc --proto_path=proto --proto_path=proto/google \
--go_out=$(API_DIR) --go_opt=paths=source_relative \
--go-grpc_out=$(API_DIR) --go-grpc_opt=paths=source_relative \
--grpc-gateway_out=$(API_DIR) --grpc-gateway_opt=paths=source_relative \
--openapiv2_out=$(SCHEMA_DIR) \
--openapiv2_opt allow_merge=true \
--openapiv2_opt merge_file_name=$(CMD_NAME) \
$(foreach dir, $(PROTO_DIRS), $(wildcard $(dir)/*.proto))
proto: check_buf
buf dep update
buf generate
test:
go test -v ./...
@ -56,13 +50,9 @@ install:
clean:
rm -rf bin/${CMD_NAME}
check_protoc:
@if ! command -v protoc-gen-go > /dev/null; then \
echo "Error: protoc-gen-go not found in PATH"; \
exit 1; \
fi
@if ! command -v protoc-gen-go-grpc > /dev/null; then \
echo "Error: protoc-gen-go-grpc not found in PATH"; \
check_buf:
@if ! command -v buf > /dev/null; then \
echo "Error: buf not found in PATH"; \
exit 1; \
fi