1 Star 0 Fork 11

liwenchao1995/mcube

forked from infraboard/mcube 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Makefile 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
Mr.Yu 提交于 2021-07-05 23:09 . add request proto
MCUBE_MAIN := "cmd/mcube/main.go"
PROTOC_GEN_GO_HTTP_MAIN = "cmd/protoc-gen-go-http/main.go"
PROJECT_NAME := "mcube"
PKG := "github.com/infraboard/$(PROJECT_NAME)"
MOD_DIR := $(shell go env GOMODCACHE)
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/ | grep -v redis | grep -v broker | grep -v etcd | grep -v examples)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
.PHONY: all dep lint vet test test-coverage build clean
all: build
push: lint test build## git push
@git push -u gitee
@git push -u origin
@rm -f build/*
dep: ## Get the dependencies
@go mod download
lint: ## Lint Golang files
@golint -set_exit_status ${PKG_LIST}
install: ## install mcube cli
@go install ${PKG}/cmd/mcube
@go install ${PKG}/cmd/protoc-gen-go-http
@go install ${PKG}/cmd/protoc-gen-go-ext
vet: ## Run go vet
@go vet ${PKG_LIST}
test: ## Run unittests
@go test -short ${PKG_LIST}
test-coverage: ## Run tests with coverage
@go test -short -coverprofile cover.out -covermode=atomic ${PKG_LIST}
@cat cover.out >> coverage.txt
test-hg: ## test http gen
@protoc -I=. -I=${GOPATH}/src --go-http_out=. examples/http/hello.proto --go-http_opt=module="github.com/infraboard/mcube"
build: dep ## Build the binary file
@go build -o build/$(PROJECT_NAME) $(MCUBE_MAIN)
clean: ## Remove previous build
@rm -f build/*
codegen: # Init Service
@protoc -I=. -I${MOD_DIR} --go-ext_out=module=${PKG}:. cmd/protoc-gen-go-ext/extension/tag/*.proto
@protoc -I=. -I${MOD_DIR} --go-ext_out=module=${PKG}:. pb/*/*.proto
@go generate ./...
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liwenchao1995/mcube.git
git@gitee.com:liwenchao1995/mcube.git
liwenchao1995
mcube
mcube
master

搜索帮助