1234567891011121314151617181920212223242526272829303132 |
- # protobuf文件列表
- API_PROTO_FILES=$(shell find api -name "*.proto")
- # protoc-gen-openapiv2插件的位置
- OPEN_API_V2_PLUGIN_FILE=./bin/protoc-gen-openapiv2.exe
- # swagger生成的目录
- SWAGGER_OUT_DIR=./gen/swagger/
- # php代码生成的目录
- PHP_OUT_DIR=./gen/php
- .PHONY: swagger
- # generate swagger file
- swagger:
- rm -rf $(SWAGGER_OUT_DIR)*
- ./bin/protoc/protoc.exe \
- --proto_path=. \
- --plugin=protoc-gen-openapiv2=$(OPEN_API_V2_PLUGIN_FILE) \
- --openapiv2_out $(SWAGGER_OUT_DIR) \
- --openapiv2_opt json_names_for_fields=false \
- $(API_PROTO_FILES)
- .PHONY: php
- php:
- ./bin/protoc/protoc.exe \
- --proto_path=. \
- --php_out $(PHP_OUT_DIR) \
- $(API_PROTO_FILES)
- .PHONY: all
- all:
- make swagger;
- make php;
|