Internal: updated build tools and scripts to work with Git instead of SVN.

This commit is contained in:
m-x-d 2016-12-27 02:05:53 +03:00
parent 9e056d8056
commit f9c2bbe44a
12 changed files with 379 additions and 352 deletions

6
.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
/GIT_Build
/Release
obj
/Build/Builder.xml
/Build/Builder.exe
/Build/Refmanual.chm

Binary file not shown.

View file

@ -2,7 +2,7 @@
ECHO.
ECHO. This build script requires the following software to be installed:
ECHO. - Microsoft Visual Studio 2008
ECHO. - Microsoft Visual Studio 2008 or newer
ECHO.
SET STUDIODIR=c:\Program Files (x86)\Microsoft Visual Studio 9.0

View file

@ -1,230 +1,235 @@
@ECHO OFF
ECHO.
ECHO. This build script requires the following software to be installed:
ECHO. - Subversion command-line client
ECHO. - Microsoft Visual Studio 2008
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 'SVN_Build' directory. Files in
ECHO. the 'SVN_Build' directory may be overwritten.
ECHO.
ECHO.
SET STUDIODIR=c:\Program Files (x86)\Microsoft Visual Studio 9.0
SET HHWDIR=c:\Program Files (x86)\HTML Help Workshop
SET SEVENZIPDIR=c:\Program Files (x86)\7-Zip
CALL "%STUDIODIR%\Common7\Tools\vsvars32.bat"
MKDIR "SVN_Build"
svn revert "Source\Core\Properties\AssemblyInfo.cs" > NUL
svn revert "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" > NUL
ECHO.
ECHO Writing SVN log file...
ECHO.
IF EXIST "SVN_Build\Changelog.xml" DEL /F /Q "SVN_Build\Changelog.xml" > NUL
svn log --xml -r HEAD:1496 > "SVN_Build\Changelog.xml"
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "SVN_Build\Changelog.xml" GOTO FILEFAIL
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
VersionFromSVN.exe "Source\Core\Properties\AssemblyInfo.cs" "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" -O "setenv.bat"
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "setenv.bat" GOTO FILEFAIL
CALL "setenv.bat"
DEL /F /Q "setenv.bat"
VersionFromEXE.exe "Build\Updater.exe" "setenv.bat"
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "setenv.bat" GOTO FILEFAIL
CALL "setenv.bat"
DEL /F /Q "setenv.bat"
ECHO.
ECHO Compiling GZDoom Builder core...
ECHO.
IF EXIST "Build\Builder.exe" DEL /F /Q "Build\Builder.exe" > NUL
IF EXIST "Source\Core\obj" RD /S /Q "Source\Core\obj"
msbuild "Source\Core\Builder.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Builder.exe" GOTO FILEFAIL
ECHO.
ECHO Compiling Automap Mode plugin...
ECHO.
IF EXIST "Build\Plugins\AutomapMode.dll" DEL /F /Q "Build\Plugins\AutomapMode.dll" > NUL
IF EXIST "Source\Plugins\AutomapMode\obj" RD /S /Q "Source\Plugins\AutomapMode\obj"
msbuild "Source\Plugins\AutomapMode\AutomapMode.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\AutomapMode.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Builder Effects plugin...
ECHO.
IF EXIST "Build\Plugins\BuilderEffects.dll" DEL /F /Q "Build\Plugins\BuilderEffects.dll" > NUL
IF EXIST "Source\Plugins\BuilderEffects\obj" RD /S /Q "Source\Plugins\BuilderEffects\obj"
msbuild "Source\Plugins\BuilderEffects\BuilderEffects.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\BuilderEffects.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Builder Modes plugin...
ECHO.
IF EXIST "Build\Plugins\BuilderModes.dll" DEL /F /Q "Build\Plugins\BuilderModes.dll" > NUL
IF EXIST "Source\Plugins\BuilderModes\obj" RD /S /Q "Source\Plugins\BuilderModes\obj"
msbuild "Source\Plugins\BuilderModes\BuilderModes.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\BuilderModes.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Color Picker plugin...
ECHO.
IF EXIST "Build\Plugins\ColorPicker.dll" DEL /F /Q "Build\Plugins\ColorPicker.dll" > NUL
IF EXIST "Source\Plugins\ColorPicker\obj" RD /S /Q "Source\Plugins\ColorPicker\obj"
msbuild "Source\Plugins\ColorPicker\ColorPicker.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\ColorPicker.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Comments Panel plugin...
ECHO.
IF EXIST "Build\Plugins\CommentsPanel.dll" DEL /F /Q "Build\Plugins\CommentsPanel.dll" > NUL
IF EXIST "Source\Plugins\CommentsPanel\obj" RD /S /Q "Source\Plugins\CommentsPanel\obj"
msbuild "Source\Plugins\CommentsPanel\CommentsPanel.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\CommentsPanel.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Nodes Viewer plugin...
ECHO.
IF EXIST "Build\Plugins\NodesViewer.dll" DEL /F /Q "Build\Plugins\NodesViewer.dll" > NUL
IF EXIST "Source\Plugins\NodesViewer\obj" RD /S /Q "Source\Plugins\NodesViewer\obj"
msbuild "Source\Plugins\NodesViewer\NodesViewer.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\NodesViewer.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Sound Propagation Mode plugin...
ECHO.
IF EXIST "Build\Plugins\SoundPropagationMode.dll" DEL /F /Q "Build\Plugins\SoundPropagationMode.dll" > NUL
IF EXIST "Source\Plugins\SoundPropagationMode\obj" RD /S /Q "Source\Plugins\SoundPropagationMode\obj"
msbuild "Source\Plugins\SoundPropagationMode\SoundPropagation.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\SoundPropagationMode.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Stair Sector Builder plugin...
ECHO.
IF EXIST "Build\Plugins\StairSectorBuilder.dll" DEL /F /Q "Build\Plugins\StairSectorBuilder.dll" > NUL
IF EXIST "Source\Plugins\StairSectorBuilder\obj" RD /S /Q "Source\Plugins\StairSectorBuilder\obj"
msbuild "Source\Plugins\StairSectorBuilder\StairSectorBuilder.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\StairSectorBuilder.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Tag Explorer plugin...
ECHO.
IF EXIST "Build\Plugins\TagExplorer.dll" DEL /F /Q "Build\Plugins\TagExplorer.dll" > NUL
IF EXIST "Source\Plugins\TagExplorer\obj" RD /S /Q "Source\Plugins\TagExplorer\obj"
msbuild "Source\Plugins\TagExplorer\TagExplorer.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\TagExplorer.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Tag Range plugin...
ECHO.
IF EXIST "Build\Plugins\TagRange.dll" DEL /F /Q "Build\Plugins\TagRange.dll" > NUL
IF EXIST "Source\Plugins\TagRange\obj" RD /S /Q "Source\Plugins\TagRange\obj"
msbuild "Source\Plugins\TagRange\TagRange.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\TagRange.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Visplane Explorer plugin...
ECHO.
IF EXIST "Build\Plugins\VisplaneExplorer.dll" DEL /F /Q "Build\Plugins\VisplaneExplorer.dll" > NUL
IF EXIST "Source\Plugins\VisplaneExplorer\obj" RD /S /Q "Source\Plugins\VisplaneExplorer\obj"
msbuild "Source\Plugins\VisplaneExplorer\VisplaneExplorer.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\VisplaneExplorer.dll" GOTO FILEFAIL
ECHO.
ECHO Creating changelog...
ECHO.
ChangelogMaker.exe "SVN_Build\Changelog.xml" "Build" "m-x-d"
IF %ERRORLEVEL% NEQ 0 GOTO LOGFAIL
ECHO.
ECHO Packing release...
ECHO.
IF EXIST "SVN_Build\*.7z" DEL /F /Q "SVN_Build\*.7z" > NUL
"%SEVENZIPDIR%\7z" a .\SVN_Build\gzdb.7z .\Build\* -xr!*.xml -xr!JetBrains.Profiler.Core.Api.dll -xr!ScintillaNET.3.5.pdb -x!Setup
"%SEVENZIPDIR%\7z" a .\SVN_Build\GZDB_Updater.7z .\Build\Updater.exe .\Build\Updater.ini
IF %ERRORLEVEL% NEQ 0 GOTO PACKFAIL
IF NOT EXIST .\SVN_Build\gzdb.7z GOTO FILEFAIL
IF NOT EXIST .\SVN_Build\GZDB_Updater.7z GOTO FILEFAIL
REN "SVN_Build\gzdb.7z" GZDoom_Builder-r%REVISIONNUMBER%.7z
IF EXIST "Build\Changelog.txt" DEL /F /Q "Build\Changelog.txt" > NUL
@ECHO %REVISIONNUMBER%> .\SVN_Build\Version.txt
@ (ECHO %REVISIONNUMBER% && ECHO %EXEREVISIONNUMBER%) > .\SVN_Build\Versions.txt
svn revert "Source\Core\Properties\AssemblyInfo.cs" > NUL
svn revert "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" > NUL
ECHO.
ECHO. BUILD DONE !
ECHO.
ECHO. Revision: %REVISIONNUMBER%
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
@ECHO OFF
ECHO.
ECHO. This build script requires the following software to be installed:
ECHO. - Git command-line client
ECHO. - Microsoft Visual Studio 2008 or newer
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.
SET STUDIODIR=c:\Program Files (x86)\Microsoft Visual Studio 9.0
SET HHWDIR=c:\Program Files (x86)\HTML Help Workshop
SET SEVENZIPDIR=c:\Program Files (x86)\7-Zip
CALL "%STUDIODIR%\Common7\Tools\vsvars32.bat"
MKDIR "GIT_Build"
git checkout "Source\Core\Properties\AssemblyInfo.cs" > NUL
git checkout "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" > NUL
ECHO.
ECHO Writing GIT log file...
ECHO.
IF EXIST "GIT_Build\Changelog.xml" DEL /F /Q "GIT_Build\Changelog.xml" > NUL
(
echo [OB]?xml version="1.0" encoding="UTF-8"?[CB]
echo [OB]log[CB]
git 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]"
echo [OB]/log[CB]
) >"GIT_Build\Changelog.xml"
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "GIT_Build\Changelog.xml" GOTO FILEFAIL
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
VersionFromGIT.exe "Source\Core\Properties\AssemblyInfo.cs" "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" -O "setenv.bat"
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "setenv.bat" GOTO FILEFAIL
CALL "setenv.bat"
DEL /F /Q "setenv.bat"
VersionFromEXE.exe "Build\Updater.exe" "setenv.bat"
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "setenv.bat" GOTO FILEFAIL
CALL "setenv.bat"
DEL /F /Q "setenv.bat"
ECHO.
ECHO Compiling GZDoom Builder core...
ECHO.
IF EXIST "Build\Builder.exe" DEL /F /Q "Build\Builder.exe" > NUL
IF EXIST "Source\Core\obj" RD /S /Q "Source\Core\obj"
msbuild "Source\Core\Builder.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Builder.exe" GOTO FILEFAIL
ECHO.
ECHO Compiling Automap Mode plugin...
ECHO.
IF EXIST "Build\Plugins\AutomapMode.dll" DEL /F /Q "Build\Plugins\AutomapMode.dll" > NUL
IF EXIST "Source\Plugins\AutomapMode\obj" RD /S /Q "Source\Plugins\AutomapMode\obj"
msbuild "Source\Plugins\AutomapMode\AutomapMode.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\AutomapMode.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Builder Effects plugin...
ECHO.
IF EXIST "Build\Plugins\BuilderEffects.dll" DEL /F /Q "Build\Plugins\BuilderEffects.dll" > NUL
IF EXIST "Source\Plugins\BuilderEffects\obj" RD /S /Q "Source\Plugins\BuilderEffects\obj"
msbuild "Source\Plugins\BuilderEffects\BuilderEffects.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\BuilderEffects.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Builder Modes plugin...
ECHO.
IF EXIST "Build\Plugins\BuilderModes.dll" DEL /F /Q "Build\Plugins\BuilderModes.dll" > NUL
IF EXIST "Source\Plugins\BuilderModes\obj" RD /S /Q "Source\Plugins\BuilderModes\obj"
msbuild "Source\Plugins\BuilderModes\BuilderModes.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\BuilderModes.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Color Picker plugin...
ECHO.
IF EXIST "Build\Plugins\ColorPicker.dll" DEL /F /Q "Build\Plugins\ColorPicker.dll" > NUL
IF EXIST "Source\Plugins\ColorPicker\obj" RD /S /Q "Source\Plugins\ColorPicker\obj"
msbuild "Source\Plugins\ColorPicker\ColorPicker.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\ColorPicker.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Comments Panel plugin...
ECHO.
IF EXIST "Build\Plugins\CommentsPanel.dll" DEL /F /Q "Build\Plugins\CommentsPanel.dll" > NUL
IF EXIST "Source\Plugins\CommentsPanel\obj" RD /S /Q "Source\Plugins\CommentsPanel\obj"
msbuild "Source\Plugins\CommentsPanel\CommentsPanel.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\CommentsPanel.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Nodes Viewer plugin...
ECHO.
IF EXIST "Build\Plugins\NodesViewer.dll" DEL /F /Q "Build\Plugins\NodesViewer.dll" > NUL
IF EXIST "Source\Plugins\NodesViewer\obj" RD /S /Q "Source\Plugins\NodesViewer\obj"
msbuild "Source\Plugins\NodesViewer\NodesViewer.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\NodesViewer.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Sound Propagation Mode plugin...
ECHO.
IF EXIST "Build\Plugins\SoundPropagationMode.dll" DEL /F /Q "Build\Plugins\SoundPropagationMode.dll" > NUL
IF EXIST "Source\Plugins\SoundPropagationMode\obj" RD /S /Q "Source\Plugins\SoundPropagationMode\obj"
msbuild "Source\Plugins\SoundPropagationMode\SoundPropagation.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\SoundPropagationMode.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Stair Sector Builder plugin...
ECHO.
IF EXIST "Build\Plugins\StairSectorBuilder.dll" DEL /F /Q "Build\Plugins\StairSectorBuilder.dll" > NUL
IF EXIST "Source\Plugins\StairSectorBuilder\obj" RD /S /Q "Source\Plugins\StairSectorBuilder\obj"
msbuild "Source\Plugins\StairSectorBuilder\StairSectorBuilder.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\StairSectorBuilder.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Tag Explorer plugin...
ECHO.
IF EXIST "Build\Plugins\TagExplorer.dll" DEL /F /Q "Build\Plugins\TagExplorer.dll" > NUL
IF EXIST "Source\Plugins\TagExplorer\obj" RD /S /Q "Source\Plugins\TagExplorer\obj"
msbuild "Source\Plugins\TagExplorer\TagExplorer.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\TagExplorer.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Tag Range plugin...
ECHO.
IF EXIST "Build\Plugins\TagRange.dll" DEL /F /Q "Build\Plugins\TagRange.dll" > NUL
IF EXIST "Source\Plugins\TagRange\obj" RD /S /Q "Source\Plugins\TagRange\obj"
msbuild "Source\Plugins\TagRange\TagRange.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\TagRange.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Visplane Explorer plugin...
ECHO.
IF EXIST "Build\Plugins\VisplaneExplorer.dll" DEL /F /Q "Build\Plugins\VisplaneExplorer.dll" > NUL
IF EXIST "Source\Plugins\VisplaneExplorer\obj" RD /S /Q "Source\Plugins\VisplaneExplorer\obj"
msbuild "Source\Plugins\VisplaneExplorer\VisplaneExplorer.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=x86 /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\VisplaneExplorer.dll" GOTO FILEFAIL
ECHO.
ECHO Creating changelog...
ECHO.
ChangelogMaker.exe "GIT_Build\Changelog.xml" "Build" "MaxED" %REVISIONNUMBER%
IF %ERRORLEVEL% NEQ 0 GOTO LOGFAIL
ECHO.
ECHO Packing release...
ECHO.
IF EXIST "GIT_Build\*.7z" DEL /F /Q "GIT_Build\*.7z" > NUL
"%SEVENZIPDIR%\7z" a .\GIT_Build\gzdb.7z .\Build\* -xr!*.xml -xr!JetBrains.Profiler.Core.Api.dll -xr!ScintillaNET.3.5.pdb -x!Setup
"%SEVENZIPDIR%\7z" a .\GIT_Build\GZDB_Updater.7z .\Build\Updater.exe .\Build\Updater.ini
IF %ERRORLEVEL% NEQ 0 GOTO PACKFAIL
IF NOT EXIST .\GIT_Build\gzdb.7z GOTO FILEFAIL
IF NOT EXIST .\GIT_Build\GZDB_Updater.7z GOTO FILEFAIL
REN "GIT_Build\gzdb.7z" GZDoom_Builder-r%REVISIONNUMBER%.7z
IF EXIST "Build\Changelog.txt" DEL /F /Q "Build\Changelog.txt" > NUL
@ECHO %REVISIONNUMBER%> .\GIT_Build\Version.txt
@ (ECHO %REVISIONNUMBER% && ECHO %EXEREVISIONNUMBER%) > .\GIT_Build\Versions.txt
git checkout "Source\Core\Properties\AssemblyInfo.cs" > NUL
git checkout "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" > NUL
ECHO.
ECHO. BUILD DONE !
ECHO.
ECHO. Revision: %REVISIONNUMBER%
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

View file

@ -2,8 +2,8 @@
ECHO.
ECHO. This build script requires the following software to be installed:
ECHO. - Subversion command-line client
ECHO. - Microsoft Visual Studio 2008
ECHO. - Git command-line client
ECHO. - Microsoft Visual Studio 2008 or newer
ECHO. - Microsoft HTML Help compiler
ECHO. - Inno Setup 5
ECHO.
@ -21,14 +21,19 @@ CALL "%STUDIODIR%\Common7\Tools\vsvars32.bat"
MKDIR "Release"
svn revert "Source\Core\Properties\AssemblyInfo.cs" > NUL
svn revert "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" > NUL
git checkout "Source\Core\Properties\AssemblyInfo.cs" > NUL
git checkout "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" > NUL
ECHO.
ECHO Writing SVN log file...
ECHO Writing GIT log file...
ECHO.
IF EXIST "Release\Changelog.xml" DEL /F /Q "Release\Changelog.xml" > NUL
svn log --xml -r HEAD:1496 > "Release\Changelog.xml"
(
echo [OB]?xml version="1.0" encoding="UTF-8"?[CB]
echo [OB]log[CB]
git 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]"
echo [OB]/log[CB]
) >"Release\Changelog.xml"
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Release\Changelog.xml" GOTO FILEFAIL
@ -44,7 +49,7 @@ ECHO.
ECHO Looking up current repository revision numbers...
ECHO.
IF EXIST "setenv.bat" DEL /F /Q "setenv.bat" > NUL
VersionFromSVN.exe "Source\Core\Properties\AssemblyInfo.cs" "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" -O "setenv.bat"
VersionFromGIT.exe "Source\Core\Properties\AssemblyInfo.cs" "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" -O "setenv.bat"
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "setenv.bat" GOTO FILEFAIL
@ -162,7 +167,7 @@ IF NOT EXIST "Build\Plugins\VisplaneExplorer.dll" GOTO FILEFAIL
ECHO.
ECHO Creating changelog...
ECHO.
ChangelogMaker.exe "SVN_Build\Changelog.xml" "Build" "m-x-d"
ChangelogMaker.exe "Release\Changelog.xml" "Build" "MaxED" %REVISIONNUMBER%
IF %ERRORLEVEL% NEQ 0 GOTO LOGFAIL
ECHO.
@ -175,8 +180,8 @@ IF NOT EXIST "Release\GZDoom Builder Setup.exe" GOTO FILEFAIL
REN "Release\GZDoom Builder Setup.exe" "GZDoom Builder R%REVISIONNUMBER% Setup.exe"
svn revert "Source\Core\Properties\AssemblyInfo.cs" > NUL
svn revert "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" > NUL
git checkout "Source\Core\Properties\AssemblyInfo.cs" > NUL
git checkout "Source\Plugins\BuilderModes\Properties\AssemblyInfo.cs" > NUL
ECHO.
ECHO. BUILD DONE !

View file

@ -1440,7 +1440,7 @@
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>call "$(DevEnvDir)..\Tools\vsvars32.bat"
<PostBuildEvent>call "%25VSINSTALLDIR%25\Common7\Tools\vsvars32.bat"
EDITBIN.EXE /NOLOGO /LARGEADDRESSAWARE "$(TargetPath)"</PostBuildEvent>
</PropertyGroup>
</Project>

View file

@ -21,39 +21,55 @@ namespace mxd.ChangelogMaker
static int Main(string[] args)
{
Console.WriteLine("Changelog Maker v01 by MaxED");
if(args.Length != 3)
Console.WriteLine("Changelog Maker v02 by MaxED");
if(args.Length != 4)
{
return Fail("USAGE: ChangelogMaker.exe input output author\n" +
return Fail("USAGE: ChangelogMaker.exe input output author revision_number\n" +
"input: xml file generated by 'svn log --xml' command\n" +
"output: directory to store Changelog.txt in\n" +
"author: commit author", 1);
"author: commit author\n" +
"revision_number: latest revision number", 1);
}
string input = args[0];
string output = args[1];
string author = args[2];
int revnum;
if(!int.TryParse(args[3], out revnum)) return Fail("Unable to parse revision number from string '" + revnum + "'.", 4);
if(!File.Exists(input)) return Fail("Input file '" + input + "' does not exist.", 2);
if(!Directory.Exists(output)) return Fail("Output folder '" + output + "' does not exist.", 3);
//Read XML
StringBuilder result = new StringBuilder(1000);
//Replace bracket placeholders, because git log command doesn't escape xml-unfriendly chars like < or >...
string inputtext = File.ReadAllText(input);
inputtext = inputtext.Replace("<", "&lt;").Replace(">", "&gt;").Replace("&", "&amp;").Replace("[OB]", "<").Replace("[CB]", ">");
XmlDocument log = new XmlDocument();
log.Load(input);
using(MemoryStream stream = new MemoryStream(Encoding.ASCII.GetBytes(inputtext)))
{
log.Load(stream);
}
StringBuilder result = new StringBuilder(1000);
foreach(XmlNode node in log.ChildNodes)
{
if(node.ChildNodes.Count == 0) continue;
foreach (XmlNode logentry in node.ChildNodes)
{
string revision = (logentry.Attributes != null ? "R" + logentry.Attributes.GetNamedItem("revision").Value : "unknown");
string commit = (logentry.Attributes != null ? logentry.Attributes.GetNamedItem("commit").Value : "unknown");
DateTime date = DateTime.Now;
string message = string.Empty;
bool skip = false;
// Add revision info...
if(logentry.Attributes != null)
{
var revinfo = log.CreateAttribute("revision");
revinfo.Value = revnum.ToString();
logentry.Attributes.SetNamedItem(revinfo);
}
foreach(XmlNode value in logentry.ChildNodes)
{
switch(value.Name)
@ -74,8 +90,10 @@ namespace mxd.ChangelogMaker
if(!skip)
{
result.Append(revision)
result.Append("R" + revnum)
.Append(" | ")
.Append(commit)
.Append(" | ")
.Append(date.ToShortDateString())
.Append(", ")
.Append(date.ToShortTimeString())
@ -86,10 +104,16 @@ namespace mxd.ChangelogMaker
.Append(Environment.NewLine)
.Append(Environment.NewLine);
}
// Decrease revision number...
revnum--;
}
break;
}
// Save modified xml
log.Save(input);
//Save result
string outputpath = Path.Combine(output, "Changelog.txt");
File.WriteAllText(outputpath, result.ToString());

View file

@ -5,7 +5,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Updater", "Updater\Updater.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersionFromEXE", "VersionFromEXE\VersionFromEXE.csproj", "{72734EB9-2733-4C05-A091-7FA591AF53C3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersionFromSVN", "VersionFromSVN\VersionFromSVN.csproj", "{58D7AB05-5FA0-47EE-8F74-463AC2AED47C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersionFromGIT", "VersionFromSVN\VersionFromGIT.csproj", "{58D7AB05-5FA0-47EE-8F74-463AC2AED47C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChangelogMaker", "ChangelogMaker\ChangelogMaker.csproj", "{5023F443-E5D2-4252-9691-19700622349E}"
EndProject

View file

@ -9,13 +9,13 @@ using System.Reflection;
#endregion
namespace mxd.VersionFromSVN
namespace mxd.VersionFromGIT
{
public static class Program
{
#region ======================== Constants
private const string SVN_INFO = "svn info -r HEAD > versionfromsvn.tmp\r\n";
private const string GIT_INFO = "@echo off\r\ngit rev-list --count master";
#endregion
@ -81,51 +81,38 @@ namespace mxd.VersionFromSVN
if(dorevisionlookup)
{
Console.WriteLine("Looking up latest subversion revision...");
Console.WriteLine("Looking up latest git revision...");
string tmppath = Path.Combine(apppath, "versionfromsvn.tmp");
string batpath = Path.Combine(apppath, "versionfromsvn.bat");
File.WriteAllText(batpath, SVN_INFO);
ProcessStartInfo info = new ProcessStartInfo
{
FileName = batpath,
CreateNoWindow = false,
ErrorDialog = false,
UseShellExecute = true,
WindowStyle = ProcessWindowStyle.Hidden,
WorkingDirectory = apppath
};
string batpath = Path.Combine(apppath, "versionfromgit.bat");
File.WriteAllText(batpath, GIT_INFO);
Process.Start(info).WaitForExit();
if(File.Exists(tmppath))
// Redirect the output stream of the child process.
Process p = new Process
{
foreach(string str in File.ReadAllLines(tmppath))
StartInfo =
{
if(str.StartsWith("Revision", StringComparison.InvariantCultureIgnoreCase))
{
string[] parts = str.Split(new[]{ ' ' });
if(parts.Length > 1)
{
revision = parts[1];
Console.Write(revision);
dorevisionlookup = false;
}
}
UseShellExecute = false,
RedirectStandardOutput = true,
WindowStyle = ProcessWindowStyle.Hidden,
FileName = batpath,
WorkingDirectory = apppath
}
};
// Redirect the output stream of the child process.
p.Start();
File.Delete(tmppath);
}
// Read the output stream first and then wait.
revision = p.StandardOutput.ReadToEnd().Trim();
p.WaitForExit();
File.Delete(batpath);
}
if(dorevisionlookup)
{
Console.WriteLine("Unable to find revision number from Subversion. You must install Subversion from http://subversion.tigris.org/.");
return 1;
//mxd. Check what we've got
int unused;
if(string.IsNullOrEmpty(revision) || !int.TryParse(revision, out unused) || unused < 1)
{
Console.WriteLine("Unable to get Git commits count from string \"" + revision + "\". You must install Git from https://git-scm.com");
return 1;
}
}
if(!string.IsNullOrEmpty(revisionoutputfile))
@ -137,9 +124,9 @@ namespace mxd.VersionFromSVN
string contents = "";
foreach(string str in targetfiles)
contents += "svn revert \"" + str + "\"\r\n";
contents += "git checkout \"" + str + "\"\r\n";
string path = Path.Combine(apppath, "versionfromsvn.bat");
string path = Path.Combine(apppath, "versionfromgit.bat");
File.WriteAllText(path, contents);
ProcessStartInfo info = new ProcessStartInfo
@ -203,19 +190,19 @@ namespace mxd.VersionFromSVN
private static void ShowUsageInfo()
{
Console.WriteLine("Version From SVN is a tool programmed by Pascal vd Heiden.\r\nThis tool requires that Subversion commandline client is installed.\r\nSee http://subversion.tigris.org/\r\n");
Console.WriteLine("Usage: versionfromsvn.exe targetfile [targetfile ...] [options]");
Console.WriteLine("Where targetfile is any text file in which the version placeholder %SVNREVISION% must be replaced with the latest revision from the SVN working copy.\r\n");
Console.WriteLine("Version From GIT is a tool programmed by MaxED.\r\nThis tool requires that Git commandline client is installed.\r\nSee https://git-scm.com\r\n");
Console.WriteLine("Usage: versionfromgit.exe targetfile [targetfile ...] [options]");
Console.WriteLine("Where targetfile is AssemblyInfo.cs file in which AssemblyVersion property value must be replaced with the commits count of the GIT master branch.\r\n");
Console.WriteLine("Options:\r\n");
Console.WriteLine("-F number");
Console.WriteLine("When this is used, the given number will be used as revision number and this program will not use Subversion to look for the real revision number (faster).\r\n");
Console.WriteLine("When this is used, the given number will be used as commits count and this program will not use Git to look for the real commits count (faster).\r\n");
Console.WriteLine("-R");
Console.WriteLine("This will revert all changes in the specified target files (same as SVN revert function). This will not apply any revision number to the target files.\r\n");
Console.WriteLine("This will revert all changes in the specified target files (same as GIT checkout function). This will not apply commits count to the target files.\r\n");
Console.WriteLine("-O filename");
Console.WriteLine("Creates a bath file, which sets REVISIONNUMBER environment variable to the SVN revision number.\r\n");
Console.WriteLine("Creates a bath file, which sets REVISIONNUMBER environment variable to the GIT revision number.\r\n");
Console.WriteLine("Press any key to quit.");
}

View file

@ -1,53 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{58D7AB05-5FA0-47EE-8F74-463AC2AED47C}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>mxd.VersionFromSVN</RootNamespace>
<AssemblyName>VersionFromSVN</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{58D7AB05-5FA0-47EE-8F74-463AC2AED47C}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>mxd.VersionFromGIT</RootNamespace>
<AssemblyName>VersionFromGIT</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

BIN
VersionFromGIT.exe Normal file

Binary file not shown.

Binary file not shown.