aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-06-17 21:55:55 +0200
committerSefa Eyeoglu <contact@scrumplex.net>2022-07-03 17:23:13 +0200
commit68c48b2c8a0c454f8746f6ab259252a6c72c4b5e (patch)
tree5519e672b1153ee6c38c28cc5fc168e29983537e
parent0f9260869b4b53b3e0a199eed808cdd5cd4fd935 (diff)
downloadPrismLauncher-68c48b2c8a0c454f8746f6ab259252a6c72c4b5e.tar.gz
PrismLauncher-68c48b2c8a0c454f8746f6ab259252a6c72c4b5e.tar.bz2
PrismLauncher-68c48b2c8a0c454f8746f6ab259252a6c72c4b5e.zip
feat: store git tag in buildconfig
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
-rw-r--r--CMakeLists.txt2
-rw-r--r--buildconfig/BuildConfig.cpp.in4
-rw-r--r--buildconfig/BuildConfig.h3
3 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c5144f6..1fdeabe3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,9 +136,11 @@ set(Launcher_CURSEFORGE_API_KEY "$2a$10$1Oqr2MX3O4n/ilhFGc597u8tfI3L2Hyr9/rtWDAM
#### Check the current Git commit and branch
include(GetGitRevisionDescription)
+git_get_exact_tag(Launcher_GIT_TAG)
get_git_head_revision(Launcher_GIT_REFSPEC Launcher_GIT_COMMIT)
message(STATUS "Git commit: ${Launcher_GIT_COMMIT}")
+message(STATUS "Git tag: ${Launcher_GIT_TAG}")
message(STATUS "Git refspec: ${Launcher_GIT_REFSPEC}")
set(Launcher_RELEASE_VERSION_NAME "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_HOTFIX}")
diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in
index 70f8f7f0..fa0fa20e 100644
--- a/buildconfig/BuildConfig.cpp.in
+++ b/buildconfig/BuildConfig.cpp.in
@@ -62,8 +62,10 @@ Config::Config()
UPDATER_BASE = "@Launcher_UPDATER_BASE@";
GIT_COMMIT = "@Launcher_GIT_COMMIT@";
+ GIT_TAG = "@Launcher_GIT_TAG@";
GIT_REFSPEC = "@Launcher_GIT_REFSPEC@";
- if (GIT_REFSPEC == QStringLiteral("GITDIR-NOTFOUND"))
+ if (GIT_REFSPEC == QStringLiteral("GITDIR-NOTFOUND")
+ || GIT_TAG == QStringLiteral("-128-NOTFOUND"))
{
VERSION_CHANNEL = QStringLiteral("stable");
}
diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h
index 8594e46d..473d7ae7 100644
--- a/buildconfig/BuildConfig.h
+++ b/buildconfig/BuildConfig.h
@@ -83,6 +83,9 @@ class Config {
/// The git commit hash of this build
QString GIT_COMMIT;
+ /// The git tag of this build
+ QString GIT_TAG;
+
/// The git refspec of this build
QString GIT_REFSPEC;