improve subwcrev to not touch svnrev.cs files if theres no change; improves typical build times substantially when working on multiclient.
This commit is contained in:
parent
8af6cac4ec
commit
ab4d663d23
32
SubWCRev.bat
32
SubWCRev.bat
|
@ -1,10 +1,34 @@
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
rem first, generate one with sed using no revision number, in case svn isnt available
|
set TEMPFILE="%TEMP%-%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%"
|
||||||
"%~1..\sed.exe" s/\$WCREV\$/0/ < "%~1properties\svnrev_template" > "%~1properties\svnrev.cs"
|
set SVNREV="%~1properties\svnrev.cs"
|
||||||
|
|
||||||
rem try generating one from svn now. this will fail if svn is nonexistent, so...
|
rem generate a wvnrev with sed using no revision number, in case svn isnt available
|
||||||
"%~1..\SubWCRev.exe" "%~1\.." "%~1properties\svnrev_template" "%~1properties\svnrev.cs"
|
@"%~1..\sed.exe" s/\$WCREV\$/0/ < "%~1properties\svnrev_template" > %TEMPFILE%
|
||||||
|
|
||||||
|
rem try generating svnrev from svn now. this will fail if svn is nonexistent, so...
|
||||||
|
@"%~1..\SubWCRev.exe" "%~1\.." "%~1properties\svnrev_template" %TEMPFILE% > nul
|
||||||
|
|
||||||
rem ... ignore the error
|
rem ... ignore the error
|
||||||
SET ERRORLEVEL=0
|
SET ERRORLEVEL=0
|
||||||
|
|
||||||
|
rem if we didnt even have a svnrev, then go ahead and copy it
|
||||||
|
if not exist %SVNREV% (
|
||||||
|
@copy /y %TEMPFILE% %SVNREV%
|
||||||
|
) else if exist %TEMPFILE% (
|
||||||
|
rem check to see whether its any different, so we dont touch unchanged files
|
||||||
|
fc /b %TEMPFILE% %SVNREV% > nul
|
||||||
|
if %ERRORLEVEL% neq 0 (
|
||||||
|
echo Updated svnrev file
|
||||||
|
@copy /y %TEMPFILE% %SVNREV%
|
||||||
|
) else (
|
||||||
|
echo Not touching unchanged svnrev file
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
echo Ran into a weird error writing subwcrev output to tempfile: %TEMPFILE%
|
||||||
|
)
|
||||||
|
|
||||||
|
del %TEMPFILE%
|
||||||
|
|
||||||
|
rem always let build proceed
|
||||||
|
SET ERRORLEVEL=0
|
Loading…
Reference in New Issue