Files
JoyD/Claw/scripts/build.sh
2026-03-16 15:47:55 +08:00

111 lines
2.9 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Claw项目构建脚本
# 用于验证项目结构和依赖
echo "🦞 开始构建 Claw 项目..."
# 检查Rust环境
if ! command -v cargo &> /dev/null; then
echo "❌ 未找到Cargo请先安装Rust"
exit 1
fi
echo "✅ Rust环境检查通过"
# 构建共享库
echo "📦 构建共享库..."
cd Server/shared
cargo check
if [ $? -ne 0 ]; then
echo "❌ 共享库构建失败"
exit 1
fi
cd ../..
echo "✅ 共享库构建成功"
# 构建网关服务
echo "🚪 构建网关服务..."
cd Server/gateway
cargo check
if [ $? -ne 0 ]; then
echo "❌ 网关服务构建失败"
exit 1
fi
cd ../..
echo "✅ 网关服务构建成功"
# 构建SmartClaw服务
echo "🤖 构建SmartClaw服务..."
cd Server/SmartClaw
cargo check
if [ $? -ne 0 ]; then
echo "❌ SmartClaw服务构建失败"
exit 1
fi
cd ../..
echo "✅ SmartClaw服务构建成功"
# 检查微信小程序结构
echo "📱 检查微信小程序结构..."
if [ ! -d "client/wechat_app" ]; then
echo "❌ 微信小程序目录不存在"
exit 1
fi
# 检查必要文件
required_files=(
"client/wechat_app/app.json"
"client/wechat_app/app.js"
"client/wechat_app/app.wxss"
"client/wechat_app/project.config.json"
"client/wechat_app/sitemap.json"
)
for file in "${required_files[@]}"; do
if [ ! -f "$file" ]; then
echo "❌ 缺少必要文件: $file"
exit 1
fi
done
echo "✅ 微信小程序结构检查通过"
# 检查企业微信网页应用
echo "🌐 检查企业微信网页应用..."
if [ ! -f "client/web/index.html" ]; then
echo "❌ 企业微信网页应用不存在"
exit 1
fi
echo "✅ 企业微信网页应用检查通过"
echo ""
echo "🎉 项目构建验证完成!"
echo ""
echo "📋 项目结构概览:"
echo "├── Server/"
echo "│ ├── gateway/ # 网关服务服务器A"
echo "│ ├── SmartClaw/ # 智能控制服务服务器B"
echo "│ └── shared/ # 共享代码库"
echo "├── client/"
echo "│ ├── wechat_app/ # 微信小程序(官方原生)"
echo "│ │ ├── pages/ # 页面目录"
echo "│ │ ├── utils/ # 工具函数"
echo "│ │ ├── components/ # 自定义组件"
echo "│ │ └── assets/ # 静态资源"
echo "│ └── web/ # 企业微信网页应用"
echo "├── docs/ # 项目文档"
echo "├── scripts/ # 构建脚本"
echo "└── build/ # 构建产物"
echo ""
echo "🚀 技术栈:"
echo "• 后端Rust + Actix Web + Embedded-Redis + HeedDB"
echo "• 前端WXML + WXSS + JavaScript微信小程序原生"
echo "• 通信WebSocket反向连接 + HTTPS"
echo "• 数据库HeedDB嵌入式+ Embedded-Redis"
echo ""
echo "✨ 项目已准备就绪,可以开始开发!"