From 7bbe2276196acd2f9dfd25dadabb94629da77651 Mon Sep 17 00:00:00 2001 From: Joe Kirchoff Date: Thu, 9 Feb 2023 15:42:34 -0500 Subject: [PATCH] UnrealBuildTool: Invalidate makefile if -Manifest= is requested but is out of date or missing #rnx #rb trivial #preflight 63e55928f306fe2858711e7f [CL 24105366 by Joe Kirchoff in ue5-main branch] --- .../UnrealBuildTool/System/TargetMakefile.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Engine/Source/Programs/UnrealBuildTool/System/TargetMakefile.cs b/Engine/Source/Programs/UnrealBuildTool/System/TargetMakefile.cs index a74f6897f556..eab06d7f5b3d 100644 --- a/Engine/Source/Programs/UnrealBuildTool/System/TargetMakefile.cs +++ b/Engine/Source/Programs/UnrealBuildTool/System/TargetMakefile.cs @@ -639,6 +639,24 @@ namespace UnrealBuildTool return null; } + // Check if any manifests are out of date + foreach (FileReference Manifest in Makefile.AdditionalArguments! + .Where(x => x.StartsWith("-Manifest=", StringComparison.OrdinalIgnoreCase)) + .Select(x => FileReference.FromString(x.Substring("-Manifest=".Length))) + .Where(x => x != null)) + { + if (!FileReference.Exists(Manifest)) + { + ReasonNotLoaded = $"manifest '{Manifest}' not found"; + return null; + } + else if (FileReference.GetLastWriteTimeUtc(Manifest) < Makefile.CreateTimeUtc) + { + ReasonNotLoaded = $"manifest '{Manifest}' not found"; + return null; + } + } + // Check if any config settings have changed. Ini files contain build settings too. if(!Makefile.ConfigValueTracker.IsValid()) {