44 lines
1.1 KiB
Makefile
Raw Normal View History

2021-01-10 15:31:37 +08:00
.PHONY:all
clean:
rm -rf ./gen/*
gofmt:
find . -name "*.go" -not -path "./" -not -path ".git/*" | xargs gofmt -s -d -w
all:
protoc \
-I . \
--go_out ./gen --go_opt paths=source_relative \
--go-grpc_out ./gen --go-grpc_opt paths=source_relative \
--grpc-gateway_out ./gen \
--grpc-gateway_opt paths=source_relative \
--grpc-gateway_opt logtostderr=true \
--grpc-gateway_opt generate_unbound_methods=true \
--openapiv2_out ./gen \
--openapiv2_opt logtostderr=true \
./service/echo/v1/echo.proto
grpc:
protoc \
-I . \
--go_out ./gen --go_opt paths=source_relative \
--go-grpc_out ./gen --go-grpc_opt paths=source_relative \
./service/echo/v1/echo.proto
gateway:
protoc \
-I . \
--grpc-gateway_out ./gen \
--grpc-gateway_opt paths=source_relative \
--grpc-gateway_opt logtostderr=true \
--grpc-gateway_opt generate_unbound_methods=true \
./service/echo/v1/echo.proto
openapi:
protoc \
-I . \
--openapiv2_out ./gen \
--openapiv2_opt logtostderr=true \
./service/echo/v1/echo.proto