Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
fix: Version information if built in Buildroot
Browse files Browse the repository at this point in the history
The Buildroot custom package build used the wrong version information
from remote-os instead of the module's git repository.
Since the git metadata information is not available during Buildroot
build, a QMake parameter is used instead.
  • Loading branch information
zehnm authored Oct 2, 2020
1 parent c2c452d commit a3dd6d5
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions dock.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,24 @@ TEMPLATE = lib
CONFIG += plugin
QT += websockets core quick

# Plugin VERSION
GIT_HASH = "$$system(git log -1 --format="%H")"
GIT_BRANCH = "$$system(git rev-parse --abbrev-ref HEAD)"
GIT_VERSION = "$$system(git describe --match "v[0-9]*" --tags HEAD --always)"
# === Version and build information ===========================================
# If built in Buildroot use custom package version, otherwise Git
isEmpty(YIO_BUILD_VERSION) {
GIT_VERSION = "$$system(git describe --match "v[0-9]*" --tags HEAD --always)"
GIT_HASH = "$$system(git log -1 --format="%H")"
GIT_BRANCH = "$$system(git rev-parse --abbrev-ref HEAD)"
} else {
GIT_VERSION = $$YIO_BUILD_VERSION
contains(GIT_VERSION, "^v?(0|[1-9]\d*)\..*") {
# (simplified) version string = regular release
GIT_HASH = ""
GIT_BRANCH = "master"
} else {
# git hash as version = custom build
GIT_HASH = $$YIO_BUILD_VERSION
GIT_BRANCH = ""
}
}
DOCK_VERSION = $$replace(GIT_VERSION, v, "")
DEFINES += PLUGIN_VERSION=\\\"$$DOCK_VERSION\\\"

Expand All @@ -16,6 +30,8 @@ win32 {
} else {
BUILDDATE=$$system(date +"%Y-%m-%dT%H:%M:%S")
}
# =============================================================================

CONFIG(debug, debug|release) {
DEBUG_BUILD = true
} else {
Expand Down

0 comments on commit a3dd6d5

Please sign in to comment.