aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorblinkseb <blinkseb@svn>2010-06-23 22:45:51 +0000
committerblinkseb <blinkseb@svn>2010-06-23 22:45:51 +0000
commitb4bdb801a69ea151ce91d6f53cab1b579a1f5f9a (patch)
tree07b6ebf6a9169395649e766f381490f9807b72ce /project
parente8a197ed3a1d2307d6cc335022a8dbf5acbf0c17 (diff)
[WIN32] added: support for git for fetching svn revision number/date
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@31341 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'project')
-rw-r--r--project/VS2008Express/update_svn_rev.bat36
-rw-r--r--project/VS2010Express/update_svn_rev.bat36
2 files changed, 68 insertions, 4 deletions
diff --git a/project/VS2008Express/update_svn_rev.bat b/project/VS2008Express/update_svn_rev.bat
index dae9b507fc..6ab91cb8fc 100644
--- a/project/VS2008Express/update_svn_rev.bat
+++ b/project/VS2008Express/update_svn_rev.bat
@@ -4,5 +4,37 @@ SET REV_FILE=..\..\xbmc\win32\svn_rev.h
IF EXIST %REV_FILE% (
del %REV_FILE%
)
-subwcrev ../.. ../../xbmc/win32/svn_rev.tmpl %REV_FILE%
-SET REV_FILE=
+
+IF EXIST "..\..\.svn" (
+ subwcrev ../.. ../../xbmc/win32/svn_rev.tmpl %REV_FILE%
+ goto :eof
+)
+
+SetLocal EnableDelayedExpansion
+
+IF EXIST "..\..\.git" (
+ FOR /F "delims=: skip=8 tokens=2*" %%a IN ('git svn info') DO (call :set_var %%a %%b)
+)
+
+copy "..\..\xbmc\win32\svn_rev_git.tmpl" "%REV_FILE%"
+
+echo #define SVN_REV "%REV%" >> %REV_FILE%
+echo #define SVN_DATE "%REV_DATE%" >> %REV_FILE%
+
+echo #endif >> %REV_FILE%
+
+goto :eof
+
+:set_var
+IF "%REV%"=="" (
+ SET REV=%1
+) ELSE IF "%REV_DATE%"=="" (
+ call :set_var_2 %1 %2 %3 %4 %5 %6 %7 %8
+)
+goto :eof
+
+:set_var_2
+SET REV_DATE=%1 %2:%3 %4 %5, %6 %7 %8^)
+goto :eof
+
+:eof \ No newline at end of file
diff --git a/project/VS2010Express/update_svn_rev.bat b/project/VS2010Express/update_svn_rev.bat
index dae9b507fc..6ab91cb8fc 100644
--- a/project/VS2010Express/update_svn_rev.bat
+++ b/project/VS2010Express/update_svn_rev.bat
@@ -4,5 +4,37 @@ SET REV_FILE=..\..\xbmc\win32\svn_rev.h
IF EXIST %REV_FILE% (
del %REV_FILE%
)
-subwcrev ../.. ../../xbmc/win32/svn_rev.tmpl %REV_FILE%
-SET REV_FILE=
+
+IF EXIST "..\..\.svn" (
+ subwcrev ../.. ../../xbmc/win32/svn_rev.tmpl %REV_FILE%
+ goto :eof
+)
+
+SetLocal EnableDelayedExpansion
+
+IF EXIST "..\..\.git" (
+ FOR /F "delims=: skip=8 tokens=2*" %%a IN ('git svn info') DO (call :set_var %%a %%b)
+)
+
+copy "..\..\xbmc\win32\svn_rev_git.tmpl" "%REV_FILE%"
+
+echo #define SVN_REV "%REV%" >> %REV_FILE%
+echo #define SVN_DATE "%REV_DATE%" >> %REV_FILE%
+
+echo #endif >> %REV_FILE%
+
+goto :eof
+
+:set_var
+IF "%REV%"=="" (
+ SET REV=%1
+) ELSE IF "%REV_DATE%"=="" (
+ call :set_var_2 %1 %2 %3 %4 %5 %6 %7 %8
+)
+goto :eof
+
+:set_var_2
+SET REV_DATE=%1 %2:%3 %4 %5, %6 %7 %8^)
+goto :eof
+
+:eof \ No newline at end of file