66 lines
1.2 KiB
Makefile
66 lines
1.2 KiB
Makefile
# Makefile
|
|
.PHONY: build clean test lint dev build-web
|
|
|
|
# 变量定义
|
|
BINARY_NAME=equipment-analyzer
|
|
BUILD_DIR=build
|
|
WEB_DIR=frontend
|
|
|
|
# 构建可执行文件
|
|
build: build-web
|
|
@echo "Building $(BINARY_NAME)..."
|
|
@mkdir -p $(BUILD_DIR)/bin
|
|
wails build -clean
|
|
|
|
# 清理构建文件
|
|
clean:
|
|
@echo "Cleaning build files..."
|
|
@rm -rf $(BUILD_DIR)
|
|
@rm -rf $(WEB_DIR)/dist
|
|
|
|
# 运行测试
|
|
test:
|
|
@echo "Running tests..."
|
|
go test -v ./...
|
|
|
|
# 代码检查
|
|
lint:
|
|
@echo "Running linter..."
|
|
golangci-lint run
|
|
|
|
# 开发模式
|
|
dev: build-web
|
|
@echo "Starting development mode..."
|
|
wails dev
|
|
|
|
# 构建前端
|
|
build-web:
|
|
@echo "Building web frontend..."
|
|
@cd $(WEB_DIR) && npm install && npm run build
|
|
|
|
# 构建发布版本
|
|
release: build-web
|
|
@echo "Building release version..."
|
|
wails build -clean
|
|
|
|
# 安装依赖
|
|
deps:
|
|
@echo "Installing dependencies..."
|
|
go mod tidy
|
|
@cd $(WEB_DIR) && npm install
|
|
|
|
# 运行集成测试
|
|
test-integration:
|
|
@echo "Running integration tests..."
|
|
go test -v ./test/integration/...
|
|
|
|
# 生成文档
|
|
docs:
|
|
@echo "Generating documentation..."
|
|
godoc -http=:6060
|
|
|
|
# 初始化项目
|
|
init:
|
|
@echo "Initializing project..."
|
|
wails init -n equipment-analyzer -t react-ts
|
|
@cd $(WEB_DIR) && npm install antd @ant-design/icons
|