Files
Migu2.0/MiGu.Server/build-and-run.bat
T
zhaowei.huangandCursor 42978930ca feat: 迁入 MiGu.Server、平台前端与车辆列表 reflection 回退
从 Simple-FR 拆出 Platform.Server 并重命名为 MiGu.Server;frontends 源码与构建脚本迁入本仓库。地图监控在 projection/cars 失败或为空时回退 reflection 车辆列表;Simple 仓库已移除旧 Platform.Server。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 18:16:34 +08:00

56 lines
1.6 KiB
Batchfile

@echo off
chcp 65001 >nul
setlocal ENABLEDELAYEDEXPANSION
REM ==========================================================
REM MiGu.Server build and run (one-click)
REM - default Debug; pass "release" / "-r" / "/r" for Release
REM - listens on http://0.0.0.0:8080 (see Properties\launchSettings.json)
REM - YARP proxies: /api/sl/* -> :8222 ; /vr/* -> :8223
REM ==========================================================
cd /d "%~dp0"
set "CONFIG=Debug"
if /I "%~1"=="release" set "CONFIG=Release"
if /I "%~1"=="-r" set "CONFIG=Release"
if /I "%~1"=="/r" set "CONFIG=Release"
echo ============================================================
echo MiGu.Server 生成 + 启动 ( Config = %CONFIG% )
echo 目录: %CD%
echo ============================================================
echo.
where dotnet >nul 2>&1
if errorlevel 1 (
echo [错误] 未找到 dotnet ^( .NET 8 SDK ^)。请先安装 .NET 8 SDK 并重新打开终端。
pause
exit /b 1
)
echo === [1/2] dotnet build ===
dotnet build "MiGu.Server.csproj" -c %CONFIG% --nologo
if errorlevel 1 (
echo.
echo *** 构建失败,已停止。请检查上方编译错误。 ***
pause
exit /b 1
)
echo.
echo === [2/2] dotnet run ===
echo [提示] Ctrl+C 终止;浏览器访问 http://localhost:8080/ ^(Swagger: /swagger^)
echo.
dotnet run --project "MiGu.Server.csproj" -c %CONFIG% --no-build --no-restore
set "RUN_EC=%errorlevel%"
echo.
if not "%RUN_EC%"=="0" (
echo *** MiGu.Server 退出,errorlevel=%RUN_EC%
) else (
echo MiGu.Server 正常退出。
)
endlocal & exit /b %RUN_EC%