Skip to content

Commit

Permalink
[WIN32] fixed: git revision in build setup file name.
Browse files Browse the repository at this point in the history
refactored the git version extraction code to be shared between the update_git_rev.bat and BuildSetup.bat scripts.
(cherry picked from commit f833d1e)
  • Loading branch information
CrystalP authored and Montellese committed Feb 6, 2011
1 parent 3dd1268 commit 13efbf5
Show file tree
Hide file tree
Showing 3 changed files with 347 additions and 356 deletions.
29 changes: 1 addition & 28 deletions project/VS2010Express/update_git_rev.bat
Expand Up @@ -6,34 +6,7 @@ IF EXIST %REV_FILE% (
del %REV_FILE%
)

rem Use tgit.exe of TortoiseGit if available
SET GITEXE="tgit.exe"
%GITEXE% --version > NUL 2>&1
if errorlevel 1 goto :notgit
GOTO :extract

:notgit

rem Fallback on msysgit, which must have been added manually to the path.
SET GITEXE="git.exe"
%GITEXE% --help > NUL 2>&1
if errorlevel 1 goto :nogit
GOTO :extract

:nogit

rem Failure - no git tool to extract information.
SET GIT_REV=Unknown
GOTO :extracted

:extract

set oldCurrentDir=%CD%
cd ..\..
FOR /F "tokens=1 delims= " %%A IN ('%GITEXE% rev-parse --short HEAD') DO SET GIT_REV=%%A
cd %oldCurrentDir%

:extracted
CALL ..\Win32BuildSetup\extract_git_rev.bat

copy "%TEMPLATE%" "%REV_FILE%"

Expand Down

0 comments on commit 13efbf5

Please sign in to comment.