mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
- Added update of version information for Windows build
- Added template file version.html.in - Removed RS_BUILD_NUMBER from Windows executable FileVersion
This commit is contained in:
parent
1412dc6466
commit
789df68582
10 changed files with 146 additions and 17 deletions
|
@ -189,9 +189,16 @@ linux-g++-64 {
|
|||
}
|
||||
|
||||
version_detail_bash_script {
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = ./version_detail.sh
|
||||
linux-* {
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = ./version_detail.sh
|
||||
}
|
||||
win32 {
|
||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||
PRE_TARGETDEPS = write_version_detail
|
||||
write_version_detail.commands = $$PWD/version_detail.bat
|
||||
}
|
||||
}
|
||||
|
||||
#################### Cross compilation for windows under Linux ####################
|
||||
|
|
|
@ -8,4 +8,5 @@
|
|||
//
|
||||
// Do not forget the 0x, since the RS_REVISION_NUMBER should be an integer.
|
||||
//
|
||||
#define RS_REVISION_STRING "01234567"
|
||||
#define RS_REVISION_NUMBER 0x01234567
|
||||
|
|
|
@ -2,4 +2,11 @@
|
|||
#define RS_MINOR_VERSION 6
|
||||
#define RS_BUILD_NUMBER 0
|
||||
#define RS_BUILD_NUMBER_ADD "x" // <-- do we need this?
|
||||
#define RS_REVISION_NUMBER $WCREV$
|
||||
|
||||
// The revision number should be the 4 first bytes of the git revision hash, which is obtained using:
|
||||
// git log --pretty="%H" | head -1 | cut -c1-8
|
||||
//
|
||||
// Do not forget the 0x, since the RS_REVISION_NUMBER should be an integer.
|
||||
//
|
||||
#define RS_REVISION_STRING "$REV$"
|
||||
#define RS_REVISION_NUMBER 0x$REV$
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
@echo off
|
||||
"D:\Programme\TortoiseSVN\bin\SubWCRev" . util\rsversion.in util\rsversion.h
|
48
libretroshare/src/version_detail.bat
Normal file
48
libretroshare/src/version_detail.bat
Normal file
|
@ -0,0 +1,48 @@
|
|||
@echo off
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
:: Search git in PATH
|
||||
set GitPath=
|
||||
for %%P in ("%PATH:;=" "%") do (
|
||||
if exist "%%~P.\git.exe" (
|
||||
set GitPath=%%~P
|
||||
goto found_git
|
||||
)
|
||||
)
|
||||
|
||||
:found_git
|
||||
if "%GitPath%"=="" (
|
||||
echo git not found in PATH. Version update cancelled.
|
||||
endlocal
|
||||
exit /B 0
|
||||
)
|
||||
|
||||
echo Update version
|
||||
|
||||
:: Retrieve git information
|
||||
set RsHash=
|
||||
|
||||
pushd "%~dp0"
|
||||
for /f "tokens=1*" %%A in ('"git log --pretty=format:"%%H" --max-count=1"') do set RsHash=%%A
|
||||
popd
|
||||
|
||||
if "%RsHash%"=="" (
|
||||
echo Git hash not found.
|
||||
endlocal
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
:: Create file
|
||||
set InFile=%~dp0retroshare\rsversion.in
|
||||
set OutFile=%~dp0retroshare\rsversion.h
|
||||
if exist "%OutFile%" del /Q "%OutFile%"
|
||||
|
||||
for /f "tokens=* delims= " %%a in (%InFile%) do (
|
||||
set line=%%a
|
||||
set line=!line:$REV$=%RsHash:~0,8%!
|
||||
echo !line!>>"%OutFile%"
|
||||
)
|
||||
|
||||
endlocal
|
||||
exit /B 0
|
Loading…
Add table
Add a link
Reference in a new issue