diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2019-08-02 13:58:43 +0300 |
---|---|---|
committer | Grigorii Zimin <gzimin@luxoft.com> | 2019-08-08 14:56:34 +0000 |
commit | d13b3510d5635bb5a423d0deb72bb85b7a5751bc (patch) | |
tree | 8803b6a46fbbcf3de192608bf312727685cbe8ff /src/remotesettings | |
parent | 0df363da0750d7806f0528190bfcd81707a2f95b (diff) |
[build] change neptune git info
Change neptune git info according to the following rules:
1) if current commit corresponds to tag -- tag is shown
2) if current commit doesn't correspond to tag and branch is specified -- BRANCH-COMMIT format is used
3) if current commit doesn't correspond to tag and branch is not specified -- COMMIT format is used
4) if OS is not unix/git folder or git is absent then "unknown revision" is shown
Change-Id: Ie6a6959ca68ad4d5dfa49a7708bdd48ce96f3c6a
Fixes: AUTOSUITE-1149
Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
Diffstat (limited to 'src/remotesettings')
-rw-r--r-- | src/remotesettings/app/DevelopmentPage.qml | 5 | ||||
-rw-r--r-- | src/remotesettings/app/app.pro | 14 | ||||
-rw-r--r-- | src/remotesettings/app/main.cpp | 1 |
3 files changed, 2 insertions, 18 deletions
diff --git a/src/remotesettings/app/DevelopmentPage.qml b/src/remotesettings/app/DevelopmentPage.qml index 66479f49..6f049124 100644 --- a/src/remotesettings/app/DevelopmentPage.qml +++ b/src/remotesettings/app/DevelopmentPage.qml @@ -443,11 +443,6 @@ Flickable { } Label { - text: qsTr("Neptune Revision Date: ") + neptuneGitCommiterDate - Layout.alignment: Qt.AlignHCenter - } - - Label { text: qsTr("Qt IVI Version: ") + qtiviVersion Layout.alignment: Qt.AlignHCenter } diff --git a/src/remotesettings/app/app.pro b/src/remotesettings/app/app.pro index 35fe08ac..22fd6da5 100644 --- a/src/remotesettings/app/app.pro +++ b/src/remotesettings/app/app.pro @@ -7,19 +7,9 @@ macos: CONFIG -= app_bundle include($$SOURCE_DIR/config.pri) -unix:exists($$SOURCE_DIR/.git):GIT_REVISION=$$system(cd "$$SOURCE_DIR" && git describe --tags --always 2>/dev/null) - -isEmpty(GIT_REVISION) { - GIT_REVISION="unknown revision" - GIT_COMMITTER_DATE="no date" -} else { - GIT_COMMITTER_DATE=$$system(cd "$$SOURCE_DIR" && git show "$$GIT_REVISION" --pretty=format:"%ci" --no-patch 2>/dev/null) -} - +load(gitUtils.prf) DEFINES *= "NEPTUNE_COMPANION_APP_VERSION=$$VERSION" -DEFINES *= NEPTUNE_GIT_REVISION=\""\\\"$$GIT_REVISION\\\""\" -DEFINES *= NEPTUNE_REVISION_DATE=\""\\\"$$GIT_COMMITTER_DATE\\\""\" -DEFINES *= NEPTUNE_INFO=\""\\\"$$GIT_REVISION, $$GIT_COMMITTER_DATE\\\""\" +DEFINES *= NEPTUNE_GIT_REVISION=\""\\\"$$currentGitRevision()\\\""\" LIBS += -L$$LIB_DESTDIR -l$$qtLibraryTarget(remotesettings) diff --git a/src/remotesettings/app/main.cpp b/src/remotesettings/app/main.cpp index 8337943c..daa26731 100644 --- a/src/remotesettings/app/main.cpp +++ b/src/remotesettings/app/main.cpp @@ -52,7 +52,6 @@ int main(int argc, char *argv[]) engine.addImportPath(QDir::currentPath()+QStringLiteral("/imports_shared/")); engine.rootContext()->setContextProperty(QStringLiteral("client"), &client); engine.rootContext()->setContextProperty("neptuneGitRevision", STR(NEPTUNE_GIT_REVISION)); - engine.rootContext()->setContextProperty("neptuneGitCommiterDate", STR(NEPTUNE_REVISION_DATE)); engine.rootContext()->setContextProperty("qtiviVersion", QTIVICORE_VERSION_STR); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (engine.rootObjects().isEmpty()) |