2using System.Text.RegularExpressions;
6using Newtonsoft.Json.Linq;
9using Nuke.Common.Utilities;
18 private Version GetEngineSemVersion()
22 buildVersion.MajorVersion,
23 buildVersion.MinorVersion,
24 buildVersion.PatchVersion
42 private Version? _semVersion =
null;
64 private int CompatibilityBaseExponent => SemanticalVersion.Major > 4 ? 32 : 0;
65 private ulong CompatibilityFlag => 1UL << (CompatibilityBaseExponent +
SemanticalVersion.Minor);
80 public override string ToString()
85 public static bool operator >= (
EngineVersion currentVersion, (
int,
int) input)
87 var (major, minor) = input;
88 return currentVersion.SemanticalVersion >=
new Version(major, minor);
91 public static bool operator <= (
EngineVersion currentVersion, (
int,
int) input)
93 var (major, minor) = input;
94 return currentVersion.SemanticalVersion <=
new Version(major, minor);
97 public static bool operator > (
EngineVersion currentVersion, (
int,
int) input)
99 var (major, minor) = input;
100 return currentVersion.SemanticalVersion >
new Version(major, minor);
103 public static bool operator < (
EngineVersion currentVersion, (
int,
int) input)
105 var (major, minor) = input;
106 return currentVersion.SemanticalVersion <
new Version(major, minor);
High level representation of an Unreal Engine version.
string VersionMinor
Only the Major.Minor version components, with extra information trimmed.
Version SemanticalVersion
Semantical version representation of the given Unreal Engine.
bool IsCompatibleWith(UnrealCompatibility compatibility)
Check if given compatibility mask applies to this version too.
AbsolutePath EnginePath
Cached engine path.
string VersionName
The canonical engine version name, only contains Major.Minor and may contain suffixes like how Unreal...
string VersionPatch
Only the full Major.Minor.Patch version components, with additional information trimmed.
UnrealCompatibility Compatibility
Compatibility flag equivalent for this version.
EngineVersion(string versionName)
Parse a high-level version from an input version identifier (semantic, guid or path)
A collection of utilities around basic functions regarding the environment of the Engine we're workin...
static UnrealBuildVersion GetBuildVersion(AbsolutePath enginePath)
Gets the parsed content of Build.version file of an engine instance.
static AbsolutePath GetEnginePath(string engineAssociation, bool ignoreCache=false)
Get the Unreal Engine path based on an input association text. (version, GUID or absolute path)
UnrealCompatibility
A flag enum representation for checking the Unreal version compatibility of various features....