Skip to content

Commit

Permalink
Changing the way BUILDNUM is generated during qmake process
Browse files Browse the repository at this point in the history
Adding a constant called BUILDDATE that is created during qmake process.
This is used to construct build number as well as snapshot versions.
  • Loading branch information
rkhaotix committed Mar 3, 2021
1 parent b8ce17d commit 379b878
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
4 changes: 2 additions & 2 deletions getbuildnum.sh
Expand Up @@ -11,11 +11,11 @@ for dir in $PATH; do
if [ $? != 0 ]; then
commit="";
else
commit=`echo ".$commit" | cut -c1-9`
commit=`echo "$commit" | cut -c1-9`
fi

break
fi
done

echo "${date}${commit}"
echo "${commit}"
3 changes: 3 additions & 0 deletions libpgmodeler_ui/ui/aboutwidget.ui
Expand Up @@ -234,6 +234,9 @@
<property name="text">
<string>(BUILD_NUM)</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="indent">
<number>-1</number>
</property>
Expand Down
8 changes: 4 additions & 4 deletions libutils/src/globalattributes.cpp
Expand Up @@ -20,17 +20,17 @@
#include <QDir>

/** Base version number **/
const QString GlobalAttributes::PgModelerVersion=QString("0.9.4-alpha");
const QString GlobalAttributes::PgModelerVersion=QString("0.9.4-alpha")

/* Appending the snapshot build number to the version number
* when the external variable SNAPSHOT_BUILD is defined */
#if defined(SNAPSHOT_BUILD)
const QString GlobalAttributes::PgModelerBuildNumber(QString(BUILDNUM) + " (snapshot)");
#else
const QString GlobalAttributes::PgModelerBuildNumber(BUILDNUM);
+ QString("_snapshot%1").arg(BUILDDATE)
#endif
;
/****/

const QString GlobalAttributes::PgModelerBuildNumber(QString("%1.%2").arg(BUILDDATE).arg(BUILDNUM));
const QString GlobalAttributes::PgModelerAppName("pgmodeler");
const QString GlobalAttributes::PgModelerURI("pgmodeler.io");
const QString GlobalAttributes::PgModelerReverseURI("io.pgmodeler");
Expand Down
2 changes: 1 addition & 1 deletion linuxdeploy.sh
Expand Up @@ -26,7 +26,7 @@ LOG="$PWD/linuxdeploy.log"
QT_IFW_ROOT=/opt/qt/Tools/QtInstallerFramework/3.2

# Detecting current pgModeler version
DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/.\+PgModelerVersion=QString("//g' | sed 's/")\;//g' | sed 's/^ *//g'`
DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/.\+PgModelerVersion=QString("//g' | sed 's/")//g' | sed 's/^ *//g'`

BUILD_DIR="$PWD/build"
DIST_DIR="$PWD/dist"
Expand Down
20 changes: 13 additions & 7 deletions pgmodeler.pri
Expand Up @@ -18,13 +18,19 @@ defined(DEMO_VERSION, var): DEFINES+=DEMO_VERSION
defined(NO_UPDATE_CHECK, var): DEFINES+=NO_UPDATE_CHECK

# Properly defining build number constant
unix {
BUILDNUM=$$system("$$PWD/getbuildnum.sh")
DEFINES+=BUILDNUM=\\\"$${BUILDNUM}\\\"
} else {
BUILDNUM=$$system("$$PWD/getbuildnum.bat")
DEFINES+=BUILDNUM=\\\"$${BUILDNUM}\\\"
}
#unix {
# BUILDNUM=$$system("$$PWD/getbuildnum.sh")
# BUILDDATE=$$system("date '+%Y%m%d'")
# DEFINES+=BUILDNUM=\\\"$${BUILDNUM}\\\"
# DEFINES+=BUILDDATE=\\\"$${BUILDDATE}\\\"
#} else {
# BUILDNUM=$$system("$$PWD/getbuildnum.bat")
# DEFINES+=BUILDNUM=\\\"$${BUILDNUM}\\\"
#}
BUILDNUM=$$system("$$PWD/getbuildnum.sh")
BUILDDATE=$$system("date '+%Y%m%d'")
DEFINES+=BUILDNUM=\\\"$${BUILDNUM}\\\"
DEFINES+=BUILDDATE=\\\"$${BUILDDATE}\\\"

# Below, the user can specify where all generated file can be placed
# through a set of variables, being them:
Expand Down

0 comments on commit 379b878

Please sign in to comment.