2using Newtonsoft.Json.Linq;
5using Nuke.Common.Utilities;
13public abstract partial class UnrealBuild : NukeBuild, IUnrealBuild
15 private AbsolutePath? _projectCache =
null;
30 if (_projectCache !=
null)
return _projectCache;
32 var projectCachePath = TemporaryDirectory /
"UProjectFile.txt";
33 if (projectCachePath.FileExists())
35 _projectCache = AbsolutePath.Create(projectCachePath.ReadAllText().Trim());
37 if (!projectCachePath.FileExists() || !_projectCache.FileExists())
39 Log.Information(
"Detecting Unreal project");
42 projectCachePath.WriteAllText(candidate);
43 _projectCache = candidate;
46 Assert.NotNull(_projectCache,
"This build doesn't seem to be an Unreal project.");
47 Log.Information($
"Unreal project: {_projectCache}");
48 return _projectCache!;
70 get => _projectDescriptor
72 protected set => _projectDescriptor = value;
Extra build related utilities not necessarily associated with Unreal tasks.
static bool LookAroundFor(Func< string, bool > predicate, out AbsolutePath? result)
Look for something in subtree of a folder or in parent folders based on a predicate.
AbsolutePath ProjectFolder
Path to folder containing the .project file.
virtual AbsolutePath ProjectPath
string ProjectName
Short name of the project.
ProjectDescriptor ProjectDescriptor
"Immutable" C# representation of the .uproject contents
AbsolutePath PluginsFolder
Path to the Unreal plugins folder of this project.
A collection of utilities around basic functions regarding the environment of the Engine we're workin...
static readonly JsonSerializerSettings JsonReadSettings
Common JsonSerializerSettings for Unreal conventions of JSON format.