From f84bc06ff3bd5377184a426ef60da7e3b276bfe1 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Tue, 14 Jan 2025 18:55:49 +0300 Subject: [PATCH] Update BuildGeneratorEditorWindow.cs --- BuildGeneratorEditorWindow.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/BuildGeneratorEditorWindow.cs b/BuildGeneratorEditorWindow.cs index 0e3a163..8cc939c 100644 --- a/BuildGeneratorEditorWindow.cs +++ b/BuildGeneratorEditorWindow.cs @@ -126,7 +126,7 @@ public class BuildGeneratorEditorWindow : EditorWindow public const int DEFAULT_MAJOR = 0; public const int DEFAULT_MINOR = 0; public const int DEFAULT_PATCH = 0; - public const int DEFAULT_RELEASE_CANDIDATE = 1; + public const int DEFAULT_RELEASE_CANDIDATE = 0; public const int RELEASE_RC_VALUE = 99; private readonly int _major; @@ -174,10 +174,13 @@ public class BuildGeneratorEditorWindow : EditorWindow _minor = _releaseCandidate = 1; } - public readonly VersionDefinition IncreaseMajor() => new(Major + 1, DEFAULT_MINOR, DEFAULT_PATCH, 0); - public readonly VersionDefinition IncreaseMinor() => new(Major, Minor + 1, DEFAULT_PATCH, 0); - public readonly VersionDefinition IncreasePatch() => new(Major, Minor, Patch + 1, 0); - public readonly VersionDefinition IncreaseReleaseCandidate() => new(Major, Minor, Patch, ReleaseCandidate + 1); + public readonly VersionDefinition IncreaseMajor() => new(Major + 1, DEFAULT_MINOR, DEFAULT_PATCH, DEFAULT_RELEASE_CANDIDATE); + public readonly VersionDefinition IncreaseMinor() => new(Major, Minor + 1, DEFAULT_PATCH, DEFAULT_RELEASE_CANDIDATE); + public readonly VersionDefinition IncreasePatch() => new(Major, Minor, Patch + 1, DEFAULT_RELEASE_CANDIDATE); + public readonly VersionDefinition IncreaseReleaseCandidate() + => ReleaseCandidate == RELEASE_RC_VALUE + ? new(Major, Minor, Patch + 1, DEFAULT_RELEASE_CANDIDATE) + : new(Major, Minor, Patch, ReleaseCandidate + 1); public readonly VersionDefinition ToReleaseVersion() => new(Major, Minor, Patch, RELEASE_RC_VALUE); public readonly int BuildNumber => int.Parse($"{Major.ToString(BUILD_NUMBER_FORMAT)}{Minor.ToString(BUILD_NUMBER_FORMAT)}{Patch.ToString(BUILD_NUMBER_FORMAT)}{ReleaseCandidate.ToString(BUILD_NUMBER_FORMAT)}"); @@ -186,7 +189,7 @@ public class BuildGeneratorEditorWindow : EditorWindow { if (IsRelease) return $"{Major}.{Minor}.{Patch}"; - return $"{Major}.{Minor}.{Patch}-rc{ReleaseCandidate}"; + return $"{Major}.{Minor}.{Patch}-rc{ReleaseCandidate + 1}"; } public static bool operator >(VersionDefinition left, VersionDefinition right) => left.BuildNumber > right.BuildNumber;