mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -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
@ -189,9 +189,16 @@ linux-g++-64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
version_detail_bash_script {
|
version_detail_bash_script {
|
||||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
linux-* {
|
||||||
PRE_TARGETDEPS = write_version_detail
|
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||||
write_version_detail.commands = ./version_detail.sh
|
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 ####################
|
#################### Cross compilation for windows under Linux ####################
|
||||||
|
@ -8,4 +8,5 @@
|
|||||||
//
|
//
|
||||||
// Do not forget the 0x, since the RS_REVISION_NUMBER should be an integer.
|
// Do not forget the 0x, since the RS_REVISION_NUMBER should be an integer.
|
||||||
//
|
//
|
||||||
|
#define RS_REVISION_STRING "01234567"
|
||||||
#define RS_REVISION_NUMBER 0x01234567
|
#define RS_REVISION_NUMBER 0x01234567
|
||||||
|
@ -2,4 +2,11 @@
|
|||||||
#define RS_MINOR_VERSION 6
|
#define RS_MINOR_VERSION 6
|
||||||
#define RS_BUILD_NUMBER 0
|
#define RS_BUILD_NUMBER 0
|
||||||
#define RS_BUILD_NUMBER_ADD "x" // <-- do we need this?
|
#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
|
4
retroshare-gui/src/gui/help/version.html.in
Normal file
4
retroshare-gui/src/gui/help/version.html.in
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Retroshare Gui version :
|
||||||
|
Git version : $Branch$
|
||||||
|
$Hash$
|
||||||
|
$Date$
|
@ -5,11 +5,11 @@
|
|||||||
IDI_ICON1 ICON "logo/logo_64.ico"
|
IDI_ICON1 ICON "logo/logo_64.ico"
|
||||||
|
|
||||||
#define STRINGIZER(version) #version
|
#define STRINGIZER(version) #version
|
||||||
#define VERSION_STRING(major,minor,build,buildadd,revision) STRINGIZER(major) "." STRINGIZER(minor) "." STRINGIZER(build) buildadd "." STRINGIZER(revision)
|
#define VERSION_STRING(major,minor,build,buildadd,revision) STRINGIZER(major) "." STRINGIZER(minor) "." STRINGIZER(build) buildadd "." revision
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,RS_REVISION_NUMBER
|
FILEVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,0
|
||||||
PRODUCTVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,RS_REVISION_NUMBER
|
PRODUCTVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,0
|
||||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||||
FILEFLAGS 0
|
FILEFLAGS 0
|
||||||
FILEOS VOS_NT_WINDOWS32
|
FILEOS VOS_NT_WINDOWS32
|
||||||
@ -22,11 +22,11 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", ""
|
VALUE "CompanyName", ""
|
||||||
VALUE "FileDescription", "RetroShare"
|
VALUE "FileDescription", "RetroShare"
|
||||||
VALUE "FileVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_NUMBER)
|
VALUE "FileVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_STRING)
|
||||||
VALUE "InternalName", "RetroShare"
|
VALUE "InternalName", "RetroShare"
|
||||||
VALUE "OriginalFilename", "RetroShare.exe"
|
VALUE "OriginalFilename", "RetroShare.exe"
|
||||||
VALUE "ProductName", "RetroShare"
|
VALUE "ProductName", "RetroShare"
|
||||||
VALUE "ProductVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_NUMBER)
|
VALUE "ProductVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_STRING)
|
||||||
VALUE "LegalCopyright", ""
|
VALUE "LegalCopyright", ""
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -118,10 +118,17 @@ linux-g++-64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
version_detail_bash_script {
|
version_detail_bash_script {
|
||||||
DEFINES += ADD_LIBRETROSHARE_VERSION_INFO
|
linux-* {
|
||||||
QMAKE_EXTRA_TARGETS += write_version_detail
|
DEFINES += ADD_LIBRETROSHARE_VERSION_INFO
|
||||||
PRE_TARGETDEPS = write_version_detail
|
QMAKE_EXTRA_TARGETS += write_version_detail
|
||||||
write_version_detail.commands = ./version_detail.sh
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
install_rs {
|
install_rs {
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
@echo off
|
|
||||||
"D:\Programme\TortoiseSVN\bin\SubWCRev" . util\rsguiversion.in util\rsguiversion.cpp
|
|
59
retroshare-gui/src/version_detail.bat
Normal file
59
retroshare-gui/src/version_detail.bat
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
@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 RsBranch=
|
||||||
|
set RsHash=
|
||||||
|
|
||||||
|
pushd "%~dp0"
|
||||||
|
for /f "tokens=1*" %%A in ('"git log --pretty=format:"%%H" --max-count=1"') do set RsHash=%%A
|
||||||
|
for /f "tokens=*" %%A in ('git rev-parse --abbrev-ref HEAD') do set RsBranch=%%A
|
||||||
|
popd
|
||||||
|
|
||||||
|
if "%RsBranch%"=="" (
|
||||||
|
echo Git branch not found.
|
||||||
|
endlocal
|
||||||
|
exit /B 1
|
||||||
|
)
|
||||||
|
if "%RsHash%"=="" (
|
||||||
|
echo Git hash not found.
|
||||||
|
endlocal
|
||||||
|
exit /B 1
|
||||||
|
)
|
||||||
|
|
||||||
|
set RsDate=%date% %TIME%
|
||||||
|
|
||||||
|
:: Create file
|
||||||
|
set InFile=%~dp0gui\help\version.html.in
|
||||||
|
set OutFile=%~dp0gui\help\version.html
|
||||||
|
if exist "%OutFile%" del /Q "%OutFile%"
|
||||||
|
|
||||||
|
for /f "tokens=* delims= " %%a in (%InFile%) do (
|
||||||
|
set line=%%a
|
||||||
|
set line=!line:$Hash$=%RsHash%!
|
||||||
|
set line=!line:$Branch$=%RsBranch%!
|
||||||
|
set line=!line:$Date$=%RsDate%!
|
||||||
|
echo !line!>>"%OutFile%"
|
||||||
|
)
|
||||||
|
|
||||||
|
endlocal
|
||||||
|
exit /B 0
|
Loading…
Reference in New Issue
Block a user