Files
UnrealEngineUWP/Engine/Source/Developer/Windows/LiveCodingServer/Private/LiveCodingServer.cpp
tim smith 899eaa25cd Improved notifications in the editor/game for live coding.
Added message that packaging can fail if assets reference new changes.

#rb
#rnx
#jira UE-115558
#preflight 60c39c8e8d00b80001b1e85f

#ROBOMERGE-SOURCE: CL 16645001 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v833-16641396)

[CL 16645007 by tim smith in ue5-release-engine-test branch]
2021-06-11 14:48:40 -04:00

127 lines
2.9 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "LiveCodingServer.h"
#include "External/LC_Scheduler.h"
#include "External/LC_UniqueId.h"
#include "External/LC_Filesystem.h"
#include "External/LC_AppSettings.h"
#include "External/LC_ServerCommandThread.h"
#include "External/LC_Compiler.h"
#include "External/LC_Environment.h"
#include "External/LC_Process.h"
FLiveCodingServer* GLiveCodingServer = nullptr;
////////////////
FLiveCodingServer::FLiveCodingServer()
{
CommandThread = nullptr;
}
FLiveCodingServer::~FLiveCodingServer()
{
check(CommandThread == nullptr);
}
void FLiveCodingServer::Start(const wchar_t* InProcessGroupName)
{
ProcessGroupName = InProcessGroupName;
scheduler::Startup();
Filesystem::Startup();
uniqueId::Startup();
appSettings::Startup(ProcessGroupName.c_str());
check(CommandThread == nullptr);
CommandThread = new ServerCommandThread(nullptr, ProcessGroupName.c_str(), RunMode::EXTERNAL_BUILD_SYSTEM);
}
void FLiveCodingServer::Stop()
{
delete CommandThread;
CommandThread = nullptr;
appSettings::Shutdown();
uniqueId::Shutdown();
Filesystem::Shutdown();
scheduler::Shutdown();
ProcessGroupName.clear();
}
void FLiveCodingServer::RestartTargets()
{
if (CommandThread != nullptr)
{
CommandThread->RestartTargets();
}
}
void FLiveCodingServer::SetLinkerPath(const wchar_t* LinkerPath, const TMap<FString, FString>& LinkerEnvironment)
{
appSettings::g_linkerPath->SetValueWithoutSaving(LinkerPath);
appSettings::UpdateLinkerPathCache();
if (LinkerEnvironment.Num() > 0)
{
Process::Environment* environment = Process::CreateEnvironmentFromMap(LinkerEnvironment);
compiler::AddEnvironmentToCache(LinkerPath, environment);
}
}
ILiveCodingServer::FBringToFrontDelegate& FLiveCodingServer::GetBringToFrontDelegate()
{
return BringToFrontDelegate;
}
ILiveCodingServer::FClearOutputDelegate& FLiveCodingServer::GetClearOutputDelegate()
{
return ClearOutputDelegate;
}
ILiveCodingServer::FStatusChangeDelegate& FLiveCodingServer::GetStatusChangeDelegate()
{
return StatusChangeDelegate;
}
ILiveCodingServer::FLogOutputDelegate& FLiveCodingServer::GetLogOutputDelegate()
{
return LogOutputDelegate;
}
ILiveCodingServer::FCompileDelegate& FLiveCodingServer::GetCompileDelegate()
{
return CompileDelegate;
}
ILiveCodingServer::FCompileStartedDelegate& FLiveCodingServer::GetCompileStartedDelegate()
{
return CompileStartedDelegate;
}
ILiveCodingServer::FCompileFinishedDelegate& FLiveCodingServer::GetCompileFinishedDelegate()
{
return CompileFinishedDelegate;
}
ILiveCodingServer::FShowConsoleDelegate& FLiveCodingServer::GetShowConsoleDelegate()
{
return ShowConsoleDelegate;
}
ILiveCodingServer::FSetVisibleDelegate& FLiveCodingServer::GetSetVisibleDelegate()
{
return SetVisibleDelegate;
}
bool FLiveCodingServer::HasReinstancingProcess()
{
return CommandThread->HasReinstancingProcess();
}
bool FLiveCodingServer::ShowCompileFinishNotification()
{
return CommandThread->ShowCompileFinishNotification();
}