MaxED wrote:which will add proper SVN revision number to the source files, compile the program and all required plugins, compile help and pack the result into "SVN_Build\GZDoom_Builder-rXXXX.7z".
I don't quite see a difference between your shell program versus mine (other than the rhetoric).
GZDoom Builder module should already do what you have mentioned - in a slightly different way. Is there something that is missing within the module that '
should' be included?
Provided is the SVN Revision protocol used in Doom Builder 2 based modules:
[NOTE: I know this is messy, I am still working on a re-write to make all of the programs and modules easier to read, avoid wasting CPU cycles, and extend its functionality without the whole spaghetti code being crafted]
Code: Select all
REM =====================================================================
REM Specific Drivers: SVN Fetch Manager
REM ----------------------------
REM Dedicated driver to fetch information in regards to the local working copy, and other operations that deals with the local working copy directory.
REM =====================================================================
:SVN_FetchManager
SET ProcessVarE=9
IF %ErrorSignal% EQU 1 SET ProcessVarB=%ProcessVarE%
IF %ProcessVarB% EQU 0 (
SET Error_MethodID=SVN_FetchManager
SET Pointer_MethodResume=SVN_FetchManager
ECHO ^> Fetching SVN Changelog History. . .
IF %ToggleLog% EQU True ECHO ^> Fetching SVN Changelog History. . .>> "%STDOUT%"
SET /A ProcessVarB=%ProcessVarB%+1
GOTO SVN_FetchManager
)
IF %ProcessVarB% EQU 1 (
SET /A ProcessVarB=%ProcessVarB%+1
GOTO SVN_FetchOldRevision
)
IF %ProcessVarB% EQU 2 (
SET /A ProcessVarB=%ProcessVarB%+1
GOTO SVN_FetchNewRevision
)
IF %ProcessVarB% EQU 3 (
SET /A ProcessVarB=%ProcessVarB%+1
GOTO SVN_FetchRevision_ModifyResult
)
IF %ProcessVarB% EQU 4 (
SET /A ProcessVarB=%ProcessVarB%+1
GOTO SVN_FetchedNewRevisionUpdateFile
)
IF %ProcessVarB% EQU 5 (
SET /A ProcessVarB=%ProcessVarB%+1
GOTO SVN_FetchHistory_Maths
)
IF %ProcessVarB% EQU 6 (
SET /A ProcessVarB=%ProcessVarB%+1
GOTO SVN_FetchHistory_MathsCheckRange
)
IF %ProcessVarB% EQU 7 (
SET /A ProcessVarB=%ProcessVarB%+1
GOTO SVN_FetchHistory
)
IF %ProcessVarB% EQU 8 (
ECHO ^< Finished
SET /A ProcessVarB=%ProcessVarB%+1
GOTO %Pointer_MethodResume%
)
IF %ProcessVarB% EQU 9 (
GOTO MainDriver
) ELSE (
GOTO OddError
)
:SVN_FetchHistory
SVN log -l %ProcessVarD% "%ProjectDirDoomBuilder%" 1> "%DirLocal%\Changelog.txt"
SET ProcessVarC=%DirLocal%\Changelog.txt
SET ProcessVarD=%DirCompileOut%\%DoomBuilder2_ProjectName%\
GOTO Invoke_intCMDCopy
:SVN_FetchOldRevision
REM Load the previous saved revision ID to a variable
IF EXIST "%DirLocal%\SVNVersion.txt" (
SET /P SVNRevisionOld=< "%DirLocal%\SVNVersion.txt"
) ELSE (
SET SVNRevisionOld=0
)
GOTO SVN_FetchManager
:SVN_FetchNewRevision
REM Find our current revision
REM This was a major pain in the ass to figure out... If it breaks - most likely we're shit out of luck....
FOR /F %%a IN ('SVNVERSION "%ProjectDirDoomBuilder%"') DO SET SVNRevisionNew=%%a
GOTO SVN_FetchManager
:SVN_FetchedNewRevisionUpdateFile
ECHO %SVNRevisionNew% 1> "%DirLocal%\SVNVersion.txt"
GOTO SVN_FetchManager
:SVN_FetchRevision_ModifyResult
REM It is possible that if the working copy is modified, the SVN Revision ID may contain non-integers. For example: 1715M
REM This is a very special variable manipulator. The idea is to remove any non-integer from the last line of the SVN Version number.
REM NOTE: Mixed Revisions is NOT supported within this check, that'll require a much more complicated procedure.
REM ----
REM If the working copy is Modified, the SVN version fetched will be reported as 1715M. Remove the Modified signature character from the variable.
SET SVNRevisionNew=%SVNRevisionNew:M=%
REM ----
REM If the working copy is Switched, the SVN version fetched will be reported as 1715S. Remove the Switch signature character from the variable.
SET SVNRevisionNew=%SVNRevisionNew:S=%
REM ----
REM If the working copy is Partial, the SVN version fetched will be reported as 1715P. Remove the Partial signature character from the variable.
SET SVNRevisionNew=%SVNRevisionNew:P=%
GOTO SVN_FetchManager
:SVN_FetchHistory_Maths
SET /A ProcessVarD=%SVNRevisionNew%-%SVNRevisionOld%
GOTO SVN_FetchManager
:SVN_FetchHistory_MathsCheckRange
REM We need to make sure that the value we have from 'SVN_FetchHistory_Maths' does not exceed the hard limit variable 'SVNRevisionHardLimit'
IF %ProcessVarD% GTR %SVNRevisionHardLimit% (
SET ProcessVarD=%SVNRevisionHardLimit%
) ELSE (
IF %ProcessVarD% LEQ 0 SET ProcessVarD=%SVNRevisionHardLimit%
)
GOTO SVN_FetchManager