enderalse/_build/build.cmd

84 lines
3.2 KiB (Stored with Git LFS)
Batchfile

@echo off
set "TARGET_DIR=%~dp0..\..\Enderal SE Build"
if exist "%TARGET_DIR%" rd /s /q "%TARGET_DIR%"
mkdir "%TARGET_DIR%"
cd /D "%TARGET_DIR%"
set "TARGET_DIR=%cd%"
set "BSARCH=%~dp0bsarch.exe"
set "TEMP_DIR=%~d0\__enderalreleasetemp"
cd /D "%~dp0.." || exit 1
set "SRC_DIR=%cd%"
cd /D "%~dp0."
call :resettemp
if not exist "%TEMP_DIR%\lodsettings" mkdir "%TEMP_DIR%\lodsettings"
if not exist "%TEMP_DIR%\meshes" mkdir "%TEMP_DIR%\meshes"
echo Copying lodsettings...
xcopy "%SRC_DIR%\lodsettings" "%TEMP_DIR%\lodsettings" /S /H /R /Y /Q
echo Copying meshes...
xcopy "%SRC_DIR%\meshes" "%TEMP_DIR%\meshes" /S /H /R /Y /Q
echo Packing into E - Meshes.bsa...
"%BSARCH%" pack "%TEMP_DIR%" "%TARGET_DIR%\E - Meshes.bsa" -q -sse -mt -share
call :resettemp
if not exist "%TEMP_DIR%\interface" mkdir "%TEMP_DIR%\interface"
if not exist "%TEMP_DIR%\strings" mkdir "%TEMP_DIR%\strings"
if not exist "%TEMP_DIR%\scripts" mkdir "%TEMP_DIR%\scripts"
echo Copying interface...
xcopy "%SRC_DIR%\interface" "%TEMP_DIR%\interface" /S /H /R /Y /Q
echo Copying strings...
xcopy "%SRC_DIR%\strings" "%TEMP_DIR%\strings" /S /H /R /Y /Q
echo Copying scripts...
xcopy "%SRC_DIR%\scripts" "%TEMP_DIR%\scripts" /S /H /R /Y /Q
echo Packing into E - Misc.bsa...
"%BSARCH%" pack "%TEMP_DIR%" "%TARGET_DIR%\E - Misc.bsa" -q -sse -mt
call :resettemp
if not exist "%TEMP_DIR%\textures" mkdir "%TEMP_DIR%\textures"
if not exist "%TEMP_DIR%\textures\enderal" mkdir "%TEMP_DIR%\textures\enderal"
echo Copying textures\enderal...
xcopy "%SRC_DIR%\textures\enderal" "%TEMP_DIR%\textures\enderal" /S /H /R /Y /Q
for %%a IN (actors,armor) do rd /s /q "%TEMP_DIR%\textures\enderal\%%a"
echo Packing into E - Textures2.bsa...
"%BSARCH%" pack "%TEMP_DIR%" "%TARGET_DIR%\E - Textures2.bsa" -q -sse -mt -z -share
echo Copying remaining textures...
xcopy "%SRC_DIR%\textures" "%TEMP_DIR%\textures" /S /H /R /Y /Q
rd /s /q "%TEMP_DIR%\textures\enderal"
for %%a IN (actors,armor) do if not exist "%TEMP_DIR%\textures\enderal\%%a" mkdir "%TEMP_DIR%\textures\enderal\%%a"
for %%a IN (actors,armor) do xcopy "%SRC_DIR%\textures\enderal\%%a" "%TEMP_DIR%\textures\enderal\%%a" /S /H /R /Y /Q
echo Packing into E - Textures1.bsa...
"%BSARCH%" pack "%TEMP_DIR%" "%TARGET_DIR%\E - Textures1.bsa" -q -sse -mt -z -share
rd /s /q "%TEMP_DIR%"
echo Copying loose files...
for /f "tokens=* usebackq" %%a IN ("loose_files.txt") do call :copyloose "%%a"
if exist "%SRC_DIR%\..\Enderal SE - Media" echo Copying video... && xcopy "%SRC_DIR%\..\Enderal SE - Media" "%TARGET_DIR%" /S /H /R /Y /Q
cd /D "%~dp0.."
"%~dp07za.exe" a "%TARGET_DIR%\ScriptsEnderal.zip" "source\scripts"
cd /D "%~dp0..\source\Enderal DLL"
"%~dp07za.exe" a "%TARGET_DIR%\SKSE\Plugins\fs_src.zip" "." -x!build -x!.vs
cd /D "%~dp0..\source\Steam DLL"
"%~dp07za.exe" a "%TARGET_DIR%\SKSE\Plugins\fs_steam_src.zip" "." -x!build -x!.vs -x!gog
pause
goto :eof
:resettemp
if exist "%TEMP_DIR%" rd /s /q "%TEMP_DIR%"
mkdir "%TEMP_DIR%"
goto :eof
:copyloose
if not exist "%TARGET_DIR%\%~1\..\." mkdir "%TARGET_DIR%\%~1\..\."
if exist "%SRC_DIR%\%~1" echo Copying %~1 && copy /Y "%SRC_DIR%\%~1" "%TARGET_DIR%\%~1" >nul
goto :eof