rewrite script to include them in the make file. Use both util/rsversion.h and gui/help/version.html for gui version information

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1473 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2009-08-01 13:53:47 +00:00
parent 19de883705
commit 96f2d92ee7
8 changed files with 88 additions and 51 deletions

View file

@ -1,5 +1,5 @@
TEMPLATE = lib
CONFIG += static
CONFIG += static version_detail_bash_script
TARGET = retroshare
CONFIG += release
@ -42,6 +42,13 @@ linux-g++-64 {
QMAKE_CC = g++
SSL_DIR = /usr/include/openssl
}
version_detail_bash_script {
QMAKE_EXTRA_TARGETS += write_version_detail
PRE_TARGETDEPS = write_version_detail
write_version_detail.commands = ./version_detail.sh
}
#################### Cross compilation for windows under Linux ####################
win32-x-g++ {

View file

@ -9,5 +9,5 @@
std::string RsUtil::retroshareVersion()
{
return std::string(VERSION);
return std::string(LIB_VERSION);
}

View file

@ -5,17 +5,12 @@
* Author: alexandrut
*/
#ifndef RSVERSION_H_
#define RSVERSION_H_
#include <string>
#define VERSION "0.5.x"
#define LIB_VERSION "0.5.x"
namespace RsUtil {
std::string retroshareVersion();
}
#endif /* RSVERSION_H_ */

View file

@ -0,0 +1,23 @@
#!/bin/bash
if ( git log -n 1 &> /dev/null); then
#retrieve git information
version="git : $(git status | grep branch | cut -c 6-) $(git log -n 1 | grep commit)"
fi
if ( git log -n 1 | grep svn &> /dev/null); then
#retrieve git svn information
version="$version svn : $(git log -n 1 | grep svn | awk '{print $2}' | head -1 | sed 's/.*@//')"
elif ( git log -n 10 | grep svn &> /dev/null); then
#retrieve git svn information
version="$version svn closest version : $(git log -n 10 | grep svn | awk '{print $2}' | head -1 | sed 's/.*@//')"
fi
if ( svn info &> /dev/null); then
version=$(svn info | head -n 5 | tail -1)
fi
if [[ $version != '' ]]; then
version="$version date : $(date +'%T %m.%d.%y')"
echo "Writing version to util/rsversion.h : $version "
sed -i "s/LIB_VERSION .*/LIB_VERSION \"$version\"/g" util/rsversion.h
fi