Skip to content

Commit

Permalink
feat!: update version format to Naming + SemVer
Browse files Browse the repository at this point in the history
  • Loading branch information
kaeeraa committed Jan 15, 2025
1 parent 91651ff commit c88c828
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,14 @@ set(Launcher_LOGIN_CALLBACK_URL "https://freesmlauncher.windstone.space/successf
set(Launcher_FMLLIBS_BASE_URL "https://files.prismlauncher.org/fmllibs/" CACHE STRING "URL for FML Libraries.")

######## Set version numbers ########
set(Launcher_VERSION_MAJOR 9)
set(Launcher_VERSION_MINOR 2)

set(Launcher_VERSION_NAME "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}")
set(Launcher_VERSION_NAME4 "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.0.0")
set(Launcher_VERSION_NAME4_COMMA "${Launcher_VERSION_MAJOR},${Launcher_VERSION_MINOR},0,0")
set(Launcher_VERSION_MAJOR 1)
set(Launcher_VERSION_MINOR 0)
set(Launcher_VERSION_PATCH 0)
set(Launcher_VERSION_CODENAME "Sequoia")

set(Launcher_VERSION_NAME "${Launcher_VERSION_CODENAME} ${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_PATCH}")
set(Launcher_VERSION_NAME4 "${Launcher_VERSION_CODENAME} ${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_PATCH}.0")
set(Launcher_VERSION_NAME4_COMMA "${Launcher_VERSION_CODENAME} ${Launcher_VERSION_MAJOR},${Launcher_VERSION_MINOR},${Launcher_VERSION_PATCH},0")

# Build platform.
set(Launcher_BUILD_PLATFORM "unknown" CACHE STRING "A short string identifying the platform that this build was built for. Only used to display in the about dialog.")
Expand Down
2 changes: 1 addition & 1 deletion buildconfig/Build.spec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

%global _name FreesmLauncher
Name: freesmlauncher
Version: 9.0
Version: Sequoia 1.0.0
Release: 0
Summary: An open source launcher for Minecraft
License: GPL-3.0-only
Expand Down
6 changes: 4 additions & 2 deletions buildconfig/BuildConfig.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Config::Config()
// Version information
VERSION_MAJOR = @Launcher_VERSION_MAJOR@;
VERSION_MINOR = @Launcher_VERSION_MINOR@;
VERSION_PATCH = @Launcher_VERSION_PATCH@;
VERSION_CODENAME = "@Launcher_VERSION_CODENAME@";

BUILD_PLATFORM = "@Launcher_BUILD_PLATFORM@";
BUILD_ARTIFACT = "@Launcher_BUILD_ARTIFACT@";
Expand Down Expand Up @@ -102,7 +104,7 @@ Config::Config()
if (GIT_REFSPEC.startsWith("refs/heads/"))
{
VERSION_CHANNEL = GIT_REFSPEC;
VERSION_CHANNEL.remove("refs/heads/");
VERSION_CHANNEL.remove("refs/heads/");
}
else if (!GIT_COMMIT.isEmpty())
{
Expand Down Expand Up @@ -136,7 +138,7 @@ Config::Config()

QString Config::versionString() const
{
return QString("%1.%2").arg(VERSION_MAJOR).arg(VERSION_MINOR);
return QString("%1 %2.%3.%4").arg(VERSION_CODENAME).arg(VERSION_MAJOR).arg(VERSION_MINOR).arg(VERSION_PATCH);
}

QString Config::printableVersionString() const
Expand Down
4 changes: 4 additions & 0 deletions buildconfig/BuildConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ class Config {
int VERSION_MAJOR;
/// The minor version number.
int VERSION_MINOR;
/// The patch version number.
int VERSION_PATCH;
/// The version codename.
QString VERSION_CODENAME;

/**
* The version channel
Expand Down
2 changes: 2 additions & 0 deletions launcher/updater/prismupdater/PrismUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,10 @@ void PrismUpdaterApp::run()

if (!loadPrismVersionFromExe(m_prismExecutable)) {
m_prismVersion = BuildConfig.printableVersionString();
m_prismVersionCodename = BuildConfig.VERSION_CODENAME;
m_prismVersionMajor = BuildConfig.VERSION_MAJOR;
m_prismVersionMinor = BuildConfig.VERSION_MINOR;
m_prismVersionPatch = BuildConfig.VERSION_PATCH;
m_prsimVersionChannel = BuildConfig.VERSION_CHANNEL;
m_prismGitCommit = BuildConfig.GIT_COMMIT;
}
Expand Down

0 comments on commit c88c828

Please sign in to comment.