feat(GODT-2655): display internal build time tag in log and GUI.

This commit is contained in:
Jakub
2023-05-26 15:07:35 +02:00
committed by Jakub Cuth
parent bfaf9765ae
commit fc06665d2b
10 changed files with 71 additions and 5 deletions

View File

@ -23,6 +23,7 @@
#define PROJECT_VENDOR "@BRIDGE_VENDOR@"
#define PROJECT_VER "@BRIDGE_APP_VERSION@"
#define PROJECT_REVISION "@BRIDGE_REVISION@"
#define PROJECT_TAG "@BRIDGE_TAG@"
#define PROJECT_BUILD_TIME "@BRIDGE_BUILD_TIME@"
#define PROJECT_DSN_SENTRY "@BRIDGE_DSN_SENTRY@"
#define PROJECT_BUILD_ENV "@BRIDGE_BUILD_ENV@"

View File

@ -286,7 +286,7 @@ QString QMLBackend::vendor() const {
//****************************************************************************************************************************************************
/// \return The value for the 'vendor' property.
/// \return The value for the 'version' property.
//****************************************************************************************************************************************************
QString QMLBackend::version() const {
HANDLE_EXCEPTION_RETURN_QSTRING(
@ -296,6 +296,15 @@ QString QMLBackend::version() const {
)
}
//****************************************************************************************************************************************************
/// \return The value for the 'tag' property.
//****************************************************************************************************************************************************
QString QMLBackend::tag() const {
HANDLE_EXCEPTION_RETURN_QSTRING(
return QString(PROJECT_TAG);
)
}
//****************************************************************************************************************************************************
/// \return The value for the 'hostname' property.

View File

@ -65,6 +65,7 @@ public: // Qt/QML properties. Note that the NOTIFY-er signal is required even fo
Q_PROPERTY(QString appname READ appname NOTIFY appnameChanged)
Q_PROPERTY(QString vendor READ vendor NOTIFY vendorChanged)
Q_PROPERTY(QString version READ version NOTIFY versionChanged)
Q_PROPERTY(QString tag READ tag NOTIFY tagChanged)
Q_PROPERTY(QString hostname READ hostname NOTIFY hostnameChanged)
Q_PROPERTY(bool isAutostartOn READ isAutostartOn NOTIFY isAutostartOnChanged)
Q_PROPERTY(bool isBetaEnabled READ isBetaEnabled NOTIFY isBetaEnabledChanged)
@ -98,6 +99,7 @@ public: // Qt/QML properties. Note that the NOTIFY-er signal is required even fo
QString appname() const; ///< Getter for the 'appname' property.
QString vendor() const; ///< Getter for the 'vendor' property.
QString version() const; ///< Getter for the 'version' property.
QString tag() const; ///< Getter for the 'tag' property.
QString hostname() const; ///< Getter for the 'hostname' property.
bool isAutostartOn() const; ///< Getter for the 'isAutostartOn' property.
bool isBetaEnabled() const; ///< Getter for the 'isBetaEnabled' property.
@ -144,6 +146,7 @@ signals: // Signal used by the Qt property system. Many of them are unused but r
void appnameChanged(QString const &appname); ///<Signal for the change of the 'appname' property.
void vendorChanged(QString const &vendor); ///<Signal for the change of the 'vendor' property.
void versionChanged(QString const &version); ///<Signal for the change of the 'version' property.
void tagChanged(QString const &tag); ///<Signal for the change of the 'tag' property.
void currentEmailClientChanged(QString const &email); ///<Signal for the change of the 'currentEmailClient' property.
void currentKeychainChanged(QString const &keychain); ///<Signal for the change of the 'currentKeychain' property.
void availableKeychainChanged(QStringList const &keychains); ///<Signal for the change of the 'availableKeychain' property.

View File

@ -76,6 +76,7 @@ function check_exit() {
Write-host "Running build for version $bridgeVersion - $buildConfig in $buildDir"
$REVISION_HASH = git rev-parse --short=10 HEAD
$bridgeTag = ($env:BRIDGE_TAG)
$bridgeDsnSentry = ($env:BRIDGE_DSN_SENTRY)
$bridgeBuidTime = ($env:BRIDGE_BUILD_TIME)
@ -93,6 +94,7 @@ git submodule update --init --recursive $vcpkgRoot
-DBRIDGE_APP_FULL_NAME="$bridgeFullName" `
-DBRIDGE_VENDOR="$bridgeVendor" `
-DBRIDGE_REVISION="$REVISION_HASH" `
-DBRIDGE_TAG="$bridgeTag" `
-DBRIDGE_APP_VERSION="$bridgeVersion" `
-DBRIDGE_BUILD_TIME="$bridgeBuidTime" `
-DBRIDGE_DSN_SENTRY="$bridgeDsnSentry" `

View File

@ -56,6 +56,7 @@ BUILD_CONFIG=${BRIDGE_GUI_BUILD_CONFIG:-Debug}
BUILD_DIR=$(echo "./cmake-build-${BUILD_CONFIG}" | tr '[:upper:]' '[:lower:]')
VCPKG_ROOT="${BRIDGE_REPO_ROOT}/extern/vcpkg"
BRIDGE_REVISION=$(git rev-parse --short=10 HEAD)
BRIDGE_TAG=${BRIDGE_TAG:-"NOTAG"}
BRIDGE_DSN_SENTRY=${BRIDGE_DSN_SENTRY}
BRIDGE_BUILD_TIME=${BRIDGE_BUILD_TIME}
BRIDGE_BUILD_ENV= ${BRIDGE_BUILD_ENV:-"dev"}
@ -97,6 +98,7 @@ cmake \
-DBRIDGE_APP_FULL_NAME="${BRIDGE_APP_FULL_NAME}" \
-DBRIDGE_VENDOR="${BRIDGE_VENDOR}" \
-DBRIDGE_REVISION="${BRIDGE_REVISION}" \
-DBRIDGE_TAG="${BRIDGE_TAG}" \
-DBRIDGE_DSN_SENTRY="${BRIDGE_DSN_SENTRY}" \
-DBRIDGE_BRIDGE_TIME="${BRIDGE_BRIDGE_TIME}" \
-DBRIDGE_BUILD_ENV="${BRIDGE_BUILD_ENV}" \

View File

@ -108,9 +108,10 @@ SettingsView {
horizontalAlignment: Text.AlignHCenter
text: qsTr("%1 v%2<br>© 2017-%3 %4<br>%5 %6<br>%7").
text: qsTr("%1 v%2 (%3)<br>© 2017-%4 %5<br>%6 %7<br>%8").
arg(Backend.appname).
arg(Backend.version).
arg(Backend.tag).
arg(Backend.buildYear()).
arg(Backend.vendor).
arg(link(Backend.licensePath, qsTr("License"))).