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

106 lines
2.8 KiB
Batchfile
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.

@echo off
REM Claw项目构建脚本Windows版
REM 用于验证项目结构和依赖
echo 🦞 开始构建 Claw 项目...
REM 检查Rust环境
where cargo >nul 2>nul
if %errorlevel% neq 0 (
echo ❌ 未找到Cargo请先安装Rust
exit /b 1
)
echo ✅ Rust环境检查通过
REM 构建共享库
echo 📦 构建共享库...
cd Server\shared
cargo check
if %errorlevel% neq 0 (
echo ❌ 共享库构建失败
exit /b 1
)
cd ..\..
echo ✅ 共享库构建成功
REM 构建网关服务
echo 🚪 构建网关服务...
cd Server\gateway
cargo check
if %errorlevel% neq 0 (
echo ❌ 网关服务构建失败
exit /b 1
)
cd ..\..
echo ✅ 网关服务构建成功
REM 构建SmartClaw服务
echo 🤖 构建SmartClaw服务...
cd Server\SmartClaw
cargo check
if %errorlevel% neq 0 (
echo ❌ SmartClaw服务构建失败
exit /b 1
)
cd ..\..
echo ✅ SmartClaw服务构建成功
REM 检查微信小程序结构
echo 📱 检查微信小程序结构...
if not exist "client\wechat_app" (
echo ❌ 微信小程序目录不存在
exit /b 1
)
REM 检查必要文件
set "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 %%f in (%required_files%) do (
if not exist "%%f" (
echo ❌ 缺少必要文件: %%f
exit /b 1
)
)
echo ✅ 微信小程序结构检查通过
REM 检查企业微信网页应用
echo 🌐 检查企业微信网页应用...
if not exist "client\web\index.html" (
echo ❌ 企业微信网页应用不存在
exit /b 1
)
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 ✨ 项目已准备就绪,可以开始开发!
pause