From 1d250994ba966f34c83eed5712d7dc48093fafa9 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Mon, 19 Oct 2020 10:52:19 +0200 Subject: [PATCH] Switch to Release Service driven versioning --- CMakeLists.txt | 13 ++++++++++++- src/CMakeLists.txt | 5 +++++ src/commit.h | 4 ---- src/irc/inputfilter.cpp | 5 ++--- src/main.cpp | 5 +---- src/version.h | 3 --- 6 files changed, 20 insertions(+), 15 deletions(-) delete mode 100644 src/commit.h delete mode 100644 src/version.h diff --git a/CMakeLists.txt b/CMakeLists.txt index bcd101e1..0c11924c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,16 @@ cmake_minimum_required (VERSION 3.5 FATAL_ERROR) -project(konversation) +# Release Service version, managed by release script +set (RELEASE_SERVICE_VERSION_MAJOR "20") +set (RELEASE_SERVICE_VERSION_MINOR "11") +set (RELEASE_SERVICE_VERSION_MICRO "70") +set (RELEASE_SERVICE_COMPACT_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}${RELEASE_SERVICE_VERSION_MINOR}${RELEASE_SERVICE_VERSION_MICRO}") + +# Bump KONVERSATION_BASE_VERSION once new features are added +set(KONVERSATION_BASE_VERSION "1.8") +set(KONVERSATION_VERSION "${KONVERSATION_BASE_VERSION}.${RELEASE_SERVICE_COMPACT_VERSION}") + +project(konversation VERSION ${KONVERSATION_VERSION}) set (QT_MIN_VERSION "5.12.0") set(KF5_MIN_VERSION "5.71.0") @@ -13,6 +23,7 @@ include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) include(ECMInstallIcons) +include(ECMSetupVersion) include(FeatureSummary) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Network Widgets) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 680053e2..94ffd2d3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -225,6 +225,11 @@ ecm_qt_declare_logging_category(konversation_SRCS EXPORT KONVERSATION ) +ecm_setup_version(${KONVERSATION_VERSION} + VARIABLE_PREFIX KONVI + VERSION_HEADER version.h +) + # Sets the icon on Windows and OSX file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../data/images/icons/*apps-konversation.png") ecm_add_app_icon(konversation_SRCS ICONS ${ICONS_SRCS}) diff --git a/src/commit.h b/src/commit.h deleted file mode 100644 index 964bbd1b..00000000 --- a/src/commit.h +++ /dev/null @@ -1,4 +0,0 @@ -// This COMMIT number is added to version string to be used as "patch level" -#ifndef COMMIT -#define COMMIT 5115 -#endif diff --git a/src/irc/inputfilter.cpp b/src/irc/inputfilter.cpp index d1a3fc46..c87a8d6b 100644 --- a/src/irc/inputfilter.cpp +++ b/src/irc/inputfilter.cpp @@ -12,7 +12,6 @@ #include "replycodes.h" #include "application.h" #include "version.h" -#include "commit.h" #include "query.h" #include "channel.h" #include "statuspanel.h" @@ -290,8 +289,8 @@ void InputFilter::parseClientCommand(const QString &prefix, const QString &comma else { // Do not internationalize the below version string - reply = QStringLiteral("Konversation %1 Build %2 Copyright 2002-2020 by the Konversation team") - .arg(QStringLiteral(KONVI_VERSION), QString::number(COMMIT)); + reply = QStringLiteral("Konversation %1 Copyright 2002-2020 by the Konversation team") + .arg(QStringLiteral(KONVI_VERSION_STRING)); } if (!reply.isEmpty()) diff --git a/src/main.cpp b/src/main.cpp index 79631e39..d2559ced 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,7 +7,6 @@ #include "application.h" #include "version.h" -#include "commit.h" #include #include @@ -18,8 +17,6 @@ #include #include -#define HACKSTR(x) #x -#define STRHACK(x) HACKSTR(x) int main(int argc, char* argv[]) { @@ -43,7 +40,7 @@ int main(int argc, char* argv[]) KAboutData aboutData(QStringLiteral("konversation"), i18n("Konversation"), - QStringLiteral(KONVI_VERSION " #" STRHACK(COMMIT)), + QStringLiteral(KONVI_VERSION_STRING), i18n("A user-friendly IRC client"), KAboutLicense::GPL, i18n("Copyright 2002-%1 by the Konversation team", QStringLiteral("2020")), diff --git a/src/version.h b/src/version.h deleted file mode 100644 index 9f09572d..00000000 --- a/src/version.h +++ /dev/null @@ -1,3 +0,0 @@ -#ifndef KONVI_VERSION -#define KONVI_VERSION "1.7-master" -#endif -- GitLab