2016-12-26 23:05:53 +00:00
|
|
|
@ECHO OFF
|
|
|
|
|
|
|
|
ECHO.
|
|
|
|
ECHO. This build script requires the following software to be installed:
|
|
|
|
ECHO. - Git command-line client
|
2022-02-06 12:54:54 +00:00
|
|
|
ECHO. - Microsoft Visual Studio 2019 or newer
|
2016-12-26 23:05:53 +00:00
|
|
|
ECHO. - Microsoft HTML Help compiler
|
|
|
|
ECHO. - 7zip
|
|
|
|
ECHO.
|
|
|
|
ECHO. You have to commit your work before using this script.
|
|
|
|
ECHO. Results will be in the 'GIT_Build' directory.
|
|
|
|
ECHO. Files in the 'GIT_Build' directory may be overwritten.
|
|
|
|
ECHO.
|
|
|
|
ECHO.
|
|
|
|
|
2022-02-06 12:54:54 +00:00
|
|
|
SET STUDIODIR=c:\Program Files (x86)\Microsoft Visual Studio\2019\Community
|
2016-12-26 23:05:53 +00:00
|
|
|
SET HHWDIR=c:\Program Files (x86)\HTML Help Workshop
|
2019-03-27 19:23:17 +00:00
|
|
|
SET SEVENZIPDIR=c:\Program Files\7-Zip
|
2019-12-24 17:45:23 +00:00
|
|
|
SET ISSDIR=c:\Program Files (x86)\Inno Setup 6
|
2016-12-26 23:05:53 +00:00
|
|
|
|
2018-04-14 15:11:19 +00:00
|
|
|
IF NOT DEFINED PLATFORM SET PLATFORM=x86
|
|
|
|
|
2019-12-24 17:45:23 +00:00
|
|
|
SET DB_OUTDIR="%CD%\GIT_Build"
|
|
|
|
IF DEFINED BUILD_RELEASE SET DB_OUTDIR="%CD%\Release"
|
|
|
|
|
|
|
|
ECHO %DB_OUTDIR%
|
|
|
|
|
2018-04-14 15:11:19 +00:00
|
|
|
CALL "%STUDIODIR%\Common7\Tools\vsdevcmd.bat" %PLATFORM%
|
|
|
|
ECHO.
|
|
|
|
ECHO Building for platform %PLATFORM%
|
|
|
|
ECHO.
|
2016-12-26 23:05:53 +00:00
|
|
|
|
2019-12-24 17:45:23 +00:00
|
|
|
MKDIR %DB_OUTDIR%
|
2016-12-26 23:05:53 +00:00
|
|
|
|
2019-03-29 18:40:55 +00:00
|
|
|
git.exe checkout "Source/Core/Properties/AssemblyInfo.cs" > NUL
|
|
|
|
git.exe checkout "Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs" > NUL
|
2016-12-26 23:05:53 +00:00
|
|
|
|
|
|
|
ECHO.
|
|
|
|
ECHO Writing GIT log file...
|
|
|
|
ECHO.
|
2019-12-24 17:45:23 +00:00
|
|
|
IF EXIST "%DB_OUTDIR%\Changelog.xml" DEL /F /Q "%DB_OUTDIR%\Changelog.xml" > NUL
|
2016-12-26 23:05:53 +00:00
|
|
|
(
|
|
|
|
echo [OB]?xml version="1.0" encoding="UTF-8"?[CB]
|
|
|
|
echo [OB]log[CB]
|
2019-03-29 18:40:55 +00:00
|
|
|
git.exe log master --since=2012-04-17 --pretty=format:"[OB]logentry commit=\"%%h\"[CB]%%n[OB]author[CB]%%an[OB]/author[CB]%%n[OB]date[CB]%%aI[OB]/date[CB]%%n[OB]msg[CB]%%B[OB]/msg[CB]%%n[OB]/logentry[CB]"
|
2016-12-26 23:05:53 +00:00
|
|
|
echo [OB]/log[CB]
|
2019-12-24 17:45:23 +00:00
|
|
|
) >"%DB_OUTDIR%\Changelog.xml"
|
2016-12-26 23:05:53 +00:00
|
|
|
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
|
2019-12-24 17:45:23 +00:00
|
|
|
IF NOT EXIST "%DB_OUTDIR%\Changelog.xml" GOTO FILEFAIL
|
2016-12-26 23:05:53 +00:00
|
|
|
|
|
|
|
ECHO.
|
|
|
|
ECHO Compiling HTML Help file...
|
|
|
|
ECHO.
|
|
|
|
IF EXIST "Build\Refmanual.chm" DEL /F /Q "Build\Refmanual.chm" > NUL
|
|
|
|
"%HHWDIR%\hhc" Help\Refmanual.hhp
|
|
|
|
IF %ERRORLEVEL% NEQ 1 GOTO ERRORFAIL
|
|
|
|
IF NOT EXIST "Build\Refmanual.chm" GOTO FILEFAIL
|
|
|
|
|
|
|
|
ECHO.
|
|
|
|
ECHO Looking up current repository revision numbers...
|
|
|
|
ECHO.
|
|
|
|
IF EXIST "setenv.bat" DEL /F /Q "setenv.bat" > NUL
|
2021-11-28 13:00:24 +00:00
|
|
|
IF DEFINED EXPERIMENTALNAME (
|
|
|
|
VersionFromGIT.exe "Source\Core\Properties\AssemblyInfo.cs" "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" -O "setenv.bat" -N %EXPERIMENTALNAME%
|
|
|
|
) ELSE (
|
|
|
|
VersionFromGIT.exe "Source\Core\Properties\AssemblyInfo.cs" "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" -O "setenv.bat"
|
|
|
|
)
|
2016-12-26 23:05:53 +00:00
|
|
|
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
|
|
|
|
IF NOT EXIST "setenv.bat" GOTO FILEFAIL
|
|
|
|
|
|
|
|
CALL "setenv.bat"
|
|
|
|
DEL /F /Q "setenv.bat"
|
|
|
|
|
2018-04-14 15:11:19 +00:00
|
|
|
ECHO.
|
2019-10-07 17:07:22 +00:00
|
|
|
ECHO Cleaning solutions...
|
2018-04-14 15:11:19 +00:00
|
|
|
ECHO.
|
|
|
|
msbuild.exe Builder.sln /t:Clean
|
2019-10-07 17:07:22 +00:00
|
|
|
msbuild.exe Source/Tools/Updater/Updater.csproj /t:Clean
|
|
|
|
|
|
|
|
ECHO.
|
|
|
|
ECHO Compiling Updater...
|
|
|
|
ECHO.
|
|
|
|
IF EXIST "Build\Updater.exe" DEL /F /Q "Build\Updater.exe" > NUL
|
|
|
|
IF EXIST "Source\Tools\Updater\obj" RD /S /Q "Source\Tools\Updater\obj"
|
|
|
|
msbuild "Source\Tools\Updater\Updater.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=%PLATFORM% /v:minimal
|
|
|
|
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
|
|
|
|
IF NOT EXIST "Build\Updater.exe" GOTO FILEFAIL
|
2018-04-14 15:11:19 +00:00
|
|
|
|
2019-12-24 21:10:34 +00:00
|
|
|
VersionFromEXE.exe "Build\Updater.exe" "setenv.bat"
|
2016-12-26 23:05:53 +00:00
|
|
|
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
|
2019-12-24 21:10:34 +00:00
|
|
|
IF NOT EXIST "setenv.bat" GOTO FILEFAIL
|
2016-12-26 23:05:53 +00:00
|
|
|
|
2019-12-24 21:10:34 +00:00
|
|
|
CALL "setenv.bat"
|
|
|
|
DEL /F /Q "setenv.bat"
|
2019-12-15 22:20:48 +00:00
|
|
|
|
2016-12-26 23:05:53 +00:00
|
|
|
ECHO.
|
2019-12-24 21:10:34 +00:00
|
|
|
ECHO Compiling Doom Builder...
|
2016-12-26 23:05:53 +00:00
|
|
|
ECHO.
|
2021-11-28 13:00:24 +00:00
|
|
|
IF DEFINED EXPERIMENTALNAME (
|
|
|
|
echo ##### BUILDING EXPERIMENTAL VERSION %EXPERIMENTALNAME%
|
|
|
|
msbuild.exe Builder.sln /t:Rebuild /p:Configuration=Release /p:Platform=%PLATFORM% /v:minimal /p:DefineConstants="TRACE;NO_UPDATER"
|
|
|
|
) ELSE (
|
|
|
|
msbuild.exe Builder.sln /t:Rebuild /p:Configuration=Release /p:Platform=%PLATFORM% /v:minimal
|
|
|
|
)
|
2016-12-26 23:05:53 +00:00
|
|
|
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
|
2019-12-24 21:10:34 +00:00
|
|
|
IF NOT EXIST "Build\Builder.exe" GOTO FILEFAIL
|
|
|
|
IF NOT EXIST "Build\BuilderNative.dll" GOTO FILEFAIL
|
2016-12-26 23:05:53 +00:00
|
|
|
IF NOT EXIST "Build\Plugins\AutomapMode.dll" GOTO FILEFAIL
|
|
|
|
IF NOT EXIST "Build\Plugins\BuilderEffects.dll" GOTO FILEFAIL
|
|
|
|
IF NOT EXIST "Build\Plugins\BuilderModes.dll" GOTO FILEFAIL
|
|
|
|
IF NOT EXIST "Build\Plugins\ColorPicker.dll" GOTO FILEFAIL
|
|
|
|
IF NOT EXIST "Build\Plugins\CommentsPanel.dll" GOTO FILEFAIL
|
|
|
|
IF NOT EXIST "Build\Plugins\NodesViewer.dll" GOTO FILEFAIL
|
|
|
|
IF NOT EXIST "Build\Plugins\SoundPropagationMode.dll" GOTO FILEFAIL
|
|
|
|
IF NOT EXIST "Build\Plugins\StairSectorBuilder.dll" GOTO FILEFAIL
|
|
|
|
IF NOT EXIST "Build\Plugins\TagExplorer.dll" GOTO FILEFAIL
|
|
|
|
IF NOT EXIST "Build\Plugins\TagRange.dll" GOTO FILEFAIL
|
2019-10-23 18:55:41 +00:00
|
|
|
IF NOT EXIST "Build\Plugins\ThreeDFloorMode.dll" GOTO FILEFAIL
|
2016-12-26 23:05:53 +00:00
|
|
|
IF NOT EXIST "Build\Plugins\VisplaneExplorer.dll" GOTO FILEFAIL
|
|
|
|
|
|
|
|
ECHO.
|
|
|
|
ECHO Creating changelog...
|
|
|
|
ECHO.
|
2019-12-24 17:45:23 +00:00
|
|
|
ChangelogMaker.exe "%DB_OUTDIR%\Changelog.xml" "Build" "m-x-d>MaxED" %REVISIONNUMBER%
|
2016-12-26 23:05:53 +00:00
|
|
|
IF %ERRORLEVEL% NEQ 0 GOTO LOGFAIL
|
|
|
|
|
|
|
|
ECHO.
|
|
|
|
ECHO Packing release...
|
|
|
|
ECHO.
|
2019-12-24 17:45:23 +00:00
|
|
|
|
|
|
|
IF NOT DEFINED BUILD_RELEASE GOTO PACKGIT
|
|
|
|
|
|
|
|
set DEL_PATHSPEC="%DB_OUTDIR%\UltimateDoomBuilder-Setup*-%PLATFORM%.exe"
|
|
|
|
IF EXIST %DEL_PATHSPEC% DEL /F /Q %DEL_PATHSPEC% > NUL
|
2022-02-27 16:19:34 +00:00
|
|
|
"%ISSDIR%\iscc.exe" /DUDB_arch=%PLATFORM% "Setup\UDBuilder_setup.iss"
|
2019-12-24 17:45:23 +00:00
|
|
|
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
|
|
|
|
IF NOT EXIST "%DB_OUTDIR%\Setup.exe" GOTO FILEFAIL
|
|
|
|
|
|
|
|
REN "%DB_OUTDIR%\Setup.exe" "UltimateDoomBuilder-Setup-R%REVISIONNUMBER%-%PLATFORM%.exe"
|
|
|
|
|
2022-02-27 16:19:34 +00:00
|
|
|
REM GOTO BUILDDONE
|
2019-12-24 17:45:23 +00:00
|
|
|
|
|
|
|
:PACKGIT
|
|
|
|
SET DEL_PATHSPEC="%DB_OUTDIR%\UltimateDoomBuilder*-%PLATFORM%.7z"
|
2018-04-14 15:11:19 +00:00
|
|
|
IF EXIST %DEL_PATHSPEC% DEL /F /Q %DEL_PATHSPEC% > NUL
|
2019-12-24 17:45:23 +00:00
|
|
|
IF EXIST "%DB_OUTDIR%\UDB_Updater-%PLATFORM%.7z" DEL /F /Q "%DB_OUTDIR%\UDB_Updater-%PLATFORM%.7z" > NUL
|
|
|
|
"%SEVENZIPDIR%\7z" a %DB_OUTDIR%\udb.7z .\Build\* -xr!*.xml -xr!JetBrains.Profiler.Core.Api.dll -xr!ScintillaNET.3.5.pdb -x!Setup
|
|
|
|
"%SEVENZIPDIR%\7z" a %DB_OUTDIR%\UDB_Updater-%PLATFORM%.7z .\Build\Updater.exe .\Build\Updater.ini
|
2016-12-26 23:05:53 +00:00
|
|
|
IF %ERRORLEVEL% NEQ 0 GOTO PACKFAIL
|
2019-12-24 17:45:23 +00:00
|
|
|
IF NOT EXIST %DB_OUTDIR%\udb.7z GOTO FILEFAIL
|
|
|
|
IF NOT EXIST %DB_OUTDIR%\UDB_Updater-%PLATFORM%.7z GOTO FILEFAIL
|
2018-04-14 15:11:19 +00:00
|
|
|
|
2019-12-24 17:45:23 +00:00
|
|
|
REN "%DB_OUTDIR%\udb.7z" UltimateDoomBuilder-r%REVISIONNUMBER%-%PLATFORM%.7z
|
2016-12-26 23:05:53 +00:00
|
|
|
|
|
|
|
IF EXIST "Build\Changelog.txt" DEL /F /Q "Build\Changelog.txt" > NUL
|
|
|
|
|
2019-12-24 17:45:23 +00:00
|
|
|
@ECHO %REVISIONNUMBER%> %DB_OUTDIR%\Version.txt
|
|
|
|
@ (ECHO %REVISIONNUMBER% && ECHO %EXEREVISIONNUMBER%) > %DB_OUTDIR%\Versions.txt
|
2016-12-26 23:05:53 +00:00
|
|
|
|
2019-03-29 18:40:55 +00:00
|
|
|
git.exe checkout "Source\Core\Properties\AssemblyInfo.cs" > NUL
|
|
|
|
git.exe checkout "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" > NUL
|
2016-12-26 23:05:53 +00:00
|
|
|
|
2019-12-24 17:45:23 +00:00
|
|
|
:BUILDDONE
|
2016-12-26 23:05:53 +00:00
|
|
|
ECHO.
|
|
|
|
ECHO. BUILD DONE !
|
|
|
|
ECHO.
|
2016-12-29 15:15:35 +00:00
|
|
|
ECHO. Revision: %REVISIONNUMBER% (%REVISIONHASH%)
|
2016-12-26 23:05:53 +00:00
|
|
|
ECHO.
|
|
|
|
PAUSE > NUL
|
|
|
|
GOTO LEAVE
|
|
|
|
|
|
|
|
:ERRORFAIL
|
|
|
|
ECHO.
|
|
|
|
ECHO. BUILD FAILED (Tool returned error %ERRORLEVEL%)
|
|
|
|
ECHO.
|
|
|
|
PAUSE > NUL
|
|
|
|
GOTO LEAVE
|
|
|
|
|
|
|
|
:PACKFAIL
|
|
|
|
ECHO.
|
|
|
|
ECHO. PACKAGING FAILED (7zip returned error %ERRORLEVEL%)
|
|
|
|
ECHO.
|
|
|
|
PAUSE > NUL
|
|
|
|
GOTO LEAVE
|
|
|
|
|
|
|
|
:FILEFAIL
|
|
|
|
ECHO.
|
|
|
|
ECHO. BUILD FAILED (Output file was not built)
|
|
|
|
ECHO.
|
|
|
|
PAUSE > NUL
|
|
|
|
GOTO LEAVE
|
|
|
|
|
|
|
|
:LOGFAIL
|
|
|
|
ECHO.
|
|
|
|
ECHO. CHANGELOG GENERATION FAILED (Tool returned error %ERRORLEVEL%)
|
|
|
|
ECHO.
|
|
|
|
PAUSE > NUL
|
|
|
|
GOTO LEAVE
|
|
|
|
|
|
|
|
:LEAVE
|
2017-01-15 01:00:40 +00:00
|
|
|
exit
|