1 Star 0 Fork 47

ethen/go-chat

forked from gzydong/go-chat 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Makefile 2.02 KB
一键复制 编辑 原始数据 按行查看 历史
gzydong 提交于 2023-11-19 19:35 . feat:优化代码
PROTO_FILES := $(shell find api -iname *.proto)
.PHONY: install
install:
go install github.com/google/wire/cmd/wire@latest \
&& go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest \
&& 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/envoyproxy/protoc-gen-validate@latest \
&& go install github.com/srikrsna/protoc-gen-gotag@latest \
.PHONY: conf
conf:
cp config.example.yaml config.yaml
.PHONY: generate
generate:
go generate ./...
lint:
golangci-lint run --timeout=5m --config ./.golangci.yml
test:
go test -v ./...
http: generate
go run ./cmd/lumenim http
commet: generate
go run ./cmd/lumenim commet
migrate:
go run ./cmd/lumenim migrate
.PHONY: build
build:generate
go build -o ./bin/lumenim ./cmd/lumenim
.PHONY: build-all
build-all:generate lint
# 构建 windows
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ./bin/lumenim ./cmd/lumenim
cp ./config.example.yaml ./build/windows/config.yaml
# 构建 linux
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/lumenim ./cmd/lumenim
cp ./config.example.yaml ./build/linux/config.yaml
# 构建 mac amd
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ./bin/lumenim ./cmd/lumenim
cp ./config.example.yaml ./build/mac/config.yaml
# 构建 mac m1
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o ./bin/lumenim ./cmd/lumenim
cp ./config.example.yaml ./build/macm1/config.yaml
.PHONY: proto
proto:
@if [ -n "$(PROTO_FILES)" ]; then \
protoc --proto_path=./api/proto \
--proto_path=./third_party \
--go_out=paths=source_relative:./api/pb/ \
--validate_out=paths=source_relative,lang=go:./api/pb/ $(PROTO_FILES) \
&& protoc --proto_path=./third_party --proto_path=./api/proto --gotag_out=outdir="./api/pb/":./ $(PROTO_FILES) \
&& echo "protoc generate success"; \
fi
.PHONY: deploy
deploy:
git reset --hard origin/develop && git pull && make build && supervisorctl reload
#--go-grpc_out=paths=source_relative:./api/pb/ \
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ethen0/go-chat.git
[email protected]:ethen0/go-chat.git
ethen0
go-chat
go-chat
master

搜索帮助