You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Live Coding: Fix support for lazy loading modules. Now passes UBT a list of modules that can be updated, and UBT fails the build and writes out a list of others that would be modified. Live Coding console then loads those modules and retries.
#rb none #jira UE-74679 #ROBOMERGE-OWNER: robert.manuszewski #ROBOMERGE-AUTHOR: ben.marsh #ROBOMERGE-SOURCE: CL 6960867 in //UE4/Release-4.23/... via CL 6966783 #ROBOMERGE-BOT: CORE (Main -> Dev-Core) (v367-6836689) [CL 6997890 by ben marsh in Dev-Core branch]
This commit is contained in:
@@ -179,7 +179,7 @@ private:
|
||||
LogWidget->AppendLine(GetLogColor(Verbosity), MoveTemp(Text));
|
||||
}
|
||||
|
||||
bool CompilePatch(const TArray<FString>& Targets, TMap<FString, TArray<FString>>& ModuleToObjectFiles)
|
||||
bool CompilePatch(const TArray<FString>& Targets, const TArray<FString>& ValidModules, TArray<FString>& RequiredModules, TMap<FString, TArray<FString>>& ModuleToObjectFiles)
|
||||
{
|
||||
// Update the compile start time. This gets copied into the last patch time once a patch has been confirmed to have been applied.
|
||||
NextPatchStartTime = FDateTime::UtcNow();
|
||||
@@ -188,21 +188,30 @@ private:
|
||||
FString Executable = FPaths::EngineDir() / TEXT("Binaries/DotNET/UnrealBuildTool.exe");
|
||||
FPaths::MakePlatformFilename(Executable);
|
||||
|
||||
// Write out the list of lazy-loaded modules for UBT to check
|
||||
FString ModulesFileName = FPaths::ConvertRelativePathToFull(FPaths::EngineIntermediateDir() / TEXT("LiveCodingModules.txt"));
|
||||
FFileHelper::SaveStringArrayToFile(ValidModules, *ModulesFileName);
|
||||
|
||||
// Delete the output file for non-whitelisted modules
|
||||
FString ModulesOutputFileName = ModulesFileName + TEXT(".out");
|
||||
IFileManager::Get().Delete(*ModulesOutputFileName);
|
||||
|
||||
// Delete any existing manifest
|
||||
FString ManifestFileName = FPaths::ConvertRelativePathToFull(FPaths::EngineIntermediateDir() / TEXT("LiveCoding.json"));
|
||||
IFileManager::Get().Delete(*ManifestFileName);
|
||||
|
||||
// Build the argument list
|
||||
FString Arguments;
|
||||
for (const FString& Target : Targets)
|
||||
{
|
||||
Arguments += FString::Printf(TEXT("-Target=\"%s\" "), *Target.Replace(TEXT("\""), TEXT("\"\"")));
|
||||
}
|
||||
|
||||
FString ManifestFileName = FPaths::ConvertRelativePathToFull(FPaths::EngineIntermediateDir() / TEXT("LiveCoding.json"));
|
||||
Arguments += FString::Printf(TEXT("-LiveCoding -LiveCodingManifest=\"%s\" -WaitMutex"), *ManifestFileName);
|
||||
|
||||
Arguments += FString::Printf(TEXT("-LiveCoding -LiveCodingModules=\"%s\" -LiveCodingManifest=\"%s\" -WaitMutex"), *ModulesFileName, *ManifestFileName);
|
||||
AppendLogLine(ELiveCodingLogVerbosity::Info, *FString::Printf(TEXT("Running %s %s"), *Executable, *Arguments));
|
||||
|
||||
// Spawn UBT and wait for it to complete (or the compile button to be pressed)
|
||||
FMonitoredProcess Process(*Executable, *Arguments, true);
|
||||
Process.OnOutput().BindLambda([this](const FString& Text){ AppendLogLine(ELiveCodingLogVerbosity::Info, *Text); });
|
||||
Process.OnOutput().BindLambda([this](const FString& Text){ AppendLogLine(ELiveCodingLogVerbosity::Info, *(FString(TEXT(" ")) + Text)); });
|
||||
Process.Launch();
|
||||
while(Process.Update())
|
||||
{
|
||||
@@ -214,9 +223,17 @@ private:
|
||||
FPlatformProcess::Sleep(0.1f);
|
||||
}
|
||||
|
||||
if (Process.GetReturnCode() != 0)
|
||||
int ReturnCode = Process.GetReturnCode();
|
||||
if (ReturnCode != 0)
|
||||
{
|
||||
AppendLogLine(ELiveCodingLogVerbosity::Failure, TEXT("Build failed."));
|
||||
if (FPaths::FileExists(ModulesOutputFileName))
|
||||
{
|
||||
FFileHelper::LoadFileToStringArray(RequiredModules, *ModulesOutputFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
AppendLogLine(ELiveCodingLogVerbosity::Failure, TEXT("Build failed."));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user