2using System.Text.RegularExpressions;
6using Newtonsoft.Json.Linq;
9using Nuke.Common.Utilities;
18 private Version GetEngineSemVersion()
20 var buildVersionPath =
EnginePath /
"Engine" /
"Build" /
"Build.version";
21 Assert.FileExists(buildVersionPath, $
"Specified path was not an Unreal Engine instance ({buildVersionPath})");
23 var buildVersion = JObject.Parse(File.ReadAllText(buildVersionPath));
25 buildVersion.GetPropertyValue<
int>(
"MajorVersion"),
26 buildVersion.GetPropertyValue<
int>(
"MinorVersion"),
27 buildVersion.GetPropertyValue<
int>(
"PatchVersion")
45 private Version? _semVersion =
null;
67 private int CompatibilityBaseExponent => SemanticalVersion.Major > 4 ? 32 : 0;
68 private ulong CompatibilityFlag => 1UL << (CompatibilityBaseExponent +
SemanticalVersion.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 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....