1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- GOHOSTOS:=$(shell go env GOHOSTOS)
- GOPATH:=$(shell go env GOPATH)
- VERSION=$(shell git describe --tags --always)
- ifeq ($(GOHOSTOS), windows)
-
-
-
-
- Git_Bash=$(subst \,/,$(subst cmd\,bin\bash.exe,$(dir $(shell where git))))
- API_PROTO_FILES=$(shell $(Git_Bash) -c "find . -not -path ./third_party/* -name *.proto")
- else
- API_PROTO_FILES=$(shell find . -not -path "./third_party/*" -name *.proto)
- endif
- .PHONY: init
- init:
- go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
- go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- go install github.com/go-kratos/kratos/cmd/kratos/v2@latest
- go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest
- go install github.com/google/gnostic/cmd/protoc-gen-openapi@latest
- go install github.com/google/wire/cmd/wire@latest
- .PHONY: errors
- errors:
- protoc --proto_path=./ \
- --proto_path=./third_party \
- --go_out=paths=source_relative:./ \
- --go-errors_out=paths=source_relative:./ \
- $(API_PROTO_FILES)
- .PHONY: api
- api:
- protoc --proto_path=./ \
- --proto_path=./third_party \
- --go_out=paths=source_relative:./ \
- --go-http_out=paths=source_relative:./ \
- --go-grpc_out=paths=source_relative:./ \
- --openapi_out=fq_schema_naming=true,default_response=false:. \
- $(API_PROTO_FILES)
- .PHONY: all
- all:
- make api;
- make errors;
|