1 Star 2 Fork 0

AdamTyn / at-kratos

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Makefile 1.94 KB
一键复制 编辑 原始数据 按行查看 历史
GOPATH:=$(shell go env GOPATH)
VERSION=$(shell git describe --tags --always)
INTERNAL_PROTO_FILES=$(shell find internal/conf -name *.proto)
API_PROTO_FILES=$(shell find api -name *.proto)
GRPC_CLIENT_PROTO_FILES=$(shell find internal/pkg/grpc_client -name *.proto)
HTTP_CLIENT_PROTO_FILES=$(shell find internal/pkg/http_client -name *.proto)
.PHONY: config
# generate config proto
config:
protoc --proto_path=./internal/conf \
--proto_path=./third_party \
--go_out=paths=source_relative:./internal/conf \
$(CONF_PROTO_FILES)
.PHONY: api
# generate api proto
api:
protoc --proto_path=./api \
--proto_path=./third_party \
--go_out=paths=source_relative:./api \
--go-grpc_out=paths=source_relative:./api \
$(API_PROTO_FILES)
.PHONY: grpc-client
# generate grpc-client proto
grpc-client:
protoc --proto_path=./internal/pkg/grpc_client \
--proto_path=./third_party \
--go_out=paths=source_relative:./api \
--go-grpc_out=paths=source_relative:./api \
$(GRPC_CLIENT_PROTO_FILES)
.PHONY: http-client
# generate http-client proto
http-client:
protoc --proto_path=./internal/pkg/http_client \
--proto_path=./third_party \
--go_out=paths=source_relative:./api \
--go-http_out=paths=source_relative:./api \
$(HTTP_CLIENT_PROTO_FILES)
.PHONY: generate
# generate wire
generate:
cd cmd/at-kratos && wire
.PHONY: build
# build
build:
mkdir -p bin/ && go build -ldflags "-X main.Version=$(VERSION)" -o ./bin/ ./...
# show help
help:
@echo ''
@echo 'Usage:'
@echo ' make [target]'
@echo ''
@echo 'Targets:'
@awk '/^[a-zA-Z0-9_-]+:/ { \
helpMessage = match(lastLine, /^# (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
Go
1
https://gitee.com/adamtyn/at-kratos.git
git@gitee.com:adamtyn/at-kratos.git
adamtyn
at-kratos
at-kratos
main

搜索帮助