-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.cmd
72 lines (55 loc) · 1.55 KB
/
release.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@echo off
setlocal
set CURDIR=%~dp0
call ..\ScrnMakeEnv.cmd %CURDIR%
echo Removing previous release files...
del /S /Q %RELEASEDIR%\*
:: Sanity check
if exist %RELEASEDIR%\System\%KFPACKAGE%.u (
echo Failed to cleanup the release directory
set /A ERR=100
goto :error
)
del %KFDIR%\System\%KFPACKAGE%.ucl 2>nul
echo Compiling project...
call make.cmd
set /A ERR=%ERRORLEVEL%
if %ERR% NEQ 0 goto error
echo Exporting .int file...
%KFDIR%\System\ucc dumpint %KFPACKAGE%.u
echo.
echo Copying release files...
xcopy /F /I /Y *.ini %RELEASEDIR%
xcopy /F /I /Y *.txt %RELEASEDIR%
xcopy /F /I /Y *.md %RELEASEDIR%
mkdir %RELEASEDIR%\System 2>nul
xcopy /F /I /Y %KFDIR%\System\%KFPACKAGE%.int %RELEASEDIR%\System\
xcopy /F /I /Y %KFDIR%\System\%KFPACKAGE%.u %RELEASEDIR%\System\
xcopy /F /I /Y %KFDIR%\System\%KFPACKAGE%.ucl %RELEASEDIR%\System\
if not exist %RELEASEDIR%\System\%KFPACKAGE%.u (
echo Release failed
set /A ERR=101
goto :error
)
echo.
echo Updating the bundle...
xcopy /F /I /Y %RELEASEDIR%\System\* %BUNDLEDIR%\System\
xcopy /F /I /Y %RELEASEDIR%\Doom3KF.ini %BUNDLEDIR%\System\
xcopy /F /I /Y %RELEASEDIR%\ScrnDoom3KF.ini %BUNDLEDIR%\System\
echo.
echo Compressing uz2...
mkdir %RELEASEDIR%\uz2 2>nul
call :MakeUz2 System\%KFPACKAGE%.u
echo %RELEASEDIR%\uz2:
dir /B %RELEASEDIR%\uz2
echo Release is ready!
goto :end
:error
color 0C
:end
endlocal & SET _EC=%ERR%
exit /b %_EC%
:MakeUz2
%KFDIR%\System\ucc compress %RELEASEDIR%\%1 && move /y %RELEASEDIR%\%1.uz2 %RELEASEDIR%\uz2\ >nul
set %~1=%~n2
exit /b 0