refactor: 统一项目名称格式并更新构建目标文件

将项目名称从"mini-chat"统一改为"minichat"格式
更新构建命令中的目标文件从$(SERVICE_STYLE).go改为main.go
This commit is contained in:
邹方成 2025-10-16 17:42:45 +08:00
parent e47e7fe70b
commit 2278218090

View File

@ -1,14 +1,14 @@
# Custom configuration | 独立配置 # Custom configuration | 独立配置
# Service name | 项目名称 # Service name | 项目名称
SERVICE=mini-chat SERVICE=minichat
# Service name in specific style | 项目经过style格式化的名称 # Service name in specific style | 项目经过style格式化的名称
SERVICE_STYLE=mini-chat SERVICE_STYLE=minichat
# Service name in lowercase | 项目名称全小写格式 # Service name in lowercase | 项目名称全小写格式
SERVICE_LOWER=mini-chat SERVICE_LOWER=minichat
# Service name in snake format | 项目名称下划线格式 # Service name in snake format | 项目名称下划线格式
SERVICE_SNAKE=mini_chat SERVICE_SNAKE=minichat
# Service name in snake format | 项目名称短杠格式 # Service name in snake format | 项目名称短杠格式
SERVICE_DASH=mini-chat SERVICE_DASH=minichat
# The project version, if you don't use git, you should set it manually | 项目版本如果不使用git请手动设置 # The project version, if you don't use git, you should set it manually | 项目版本如果不使用git请手动设置
VERSION=$(shell git describe --tags --always) VERSION=$(shell git describe --tags --always)
@ -93,17 +93,17 @@ gen-api: # Generate API files | 生成 API 的代码
.PHONY: build-win .PHONY: build-win
build-win: # Build project for Windows | 构建Windows下的可执行文件 build-win: # Build project for Windows | 构建Windows下的可执行文件
env CGO_ENABLED=0 GOOS=windows go build -ldflags "$(LDFLAGS)" -o $(SERVICE_STYLE)_$(PROJECT_BUILD_SUFFIX).exe $(SERVICE_STYLE).go env CGO_ENABLED=0 GOOS=windows go build -ldflags "$(LDFLAGS)" -o $(SERVICE_STYLE)_$(PROJECT_BUILD_SUFFIX).exe main.go
@echo "Build project for Windows successfully" @echo "Build project for Windows successfully"
.PHONY: build-mac .PHONY: build-mac
build-mac: # Build project for MacOS | 构建MacOS下的可执行文件 build-mac: # Build project for MacOS | 构建MacOS下的可执行文件
env CGO_ENABLED=0 GOOS=darwin go build -ldflags "$(LDFLAGS)" -o $(SERVICE_STYLE)_$(PROJECT_BUILD_SUFFIX) $(SERVICE_STYLE).go env CGO_ENABLED=0 GOOS=darwin go build -ldflags "$(LDFLAGS)" -o $(SERVICE_STYLE)_$(PROJECT_BUILD_SUFFIX) main.go
@echo "Build project for MacOS successfully" @echo "Build project for MacOS successfully"
.PHONY: build-linux .PHONY: build-linux
build-linux: # Build project for Linux | 构建Linux下的可执行文件 build-linux: # Build project for Linux | 构建Linux下的可执行文件
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o $(SERVICE_STYLE)_$(PROJECT_BUILD_SUFFIX) $(SERVICE_STYLE).go env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o $(SERVICE_STYLE)_$(PROJECT_BUILD_SUFFIX) main.go
@echo "Build project for Linux successfully" @echo "Build project for Linux successfully"
.PHONY: proto2api .PHONY: proto2api