Files
squad-rain-ops-mini/build_windows_x64.bat

54 lines
1.8 KiB
Batchfile

@echo off
echo =======================================================
echo RainOps RCON Query Build Script
echo =======================================================
echo.
echo [1/3] Cleaning old files...
if exist "bin\Release\net6.0\win-x64\publish" (
rd /s /q "bin\Release\net6.0\win-x64\publish"
echo Old files cleaned.
) else (
echo No clean up needed.
)
echo.
rem Additional cleanup and restore to avoid slow copy of stale assets
dotnet clean -c Release
dotnet restore
echo [2/3] Publishing single file (win-x64, trimmed)...
echo Executing: dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishReadyToRun=false -p:PublishTrimmed=true -p:TrimMode=link -p:DebugType=None -v minimal -o "bin\Release\net6.0\win-x64\publish"
echo.
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishReadyToRun=false -p:PublishTrimmed=true -p:TrimMode=link -p:DebugType=None -v minimal -o "bin\Release\net6.0\win-x64\publish"
if %errorlevel% neq 0 (
echo.
echo [ERROR] Build failed! Please check the error messages above.
color 0c
pause
exit /b %errorlevel%
)
echo.
echo [3/3] Build success! Cleaning up artifacts...
echo.
cd "bin\Release\net6.0\win-x64\publish"
if exist "RainOpsMini.exe" (
rem Keep only the exe and pdb if needed, delete others to ensure single file distribution
for %%F in (*) do if not "%%F"=="RainOpsMini.exe" if not "%%F"=="RainOpsMini.pdb" del "%%F"
for /d %%D in (*) do rd /s /q "%%D"
)
cd ..\..\..\..\..
echo.
echo =======================================================
echo Output Location:
echo bin\Release\net6.0\win-x64\publish\RainOpsMini.exe
echo =======================================================
echo.
explorer "bin\Release\net6.0\win-x64\publish"
pause