Integrating live coding feature (aka Live++) into UE4.

Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.

Changes vs standalone Live++ version:

* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.

Known issues:

* Does not currently support class layout changes / object reinstancing

#rb none
#fyi Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira

[CL 5304722 by Ben Marsh in 4.22 branch]
This commit is contained in:
Ben Marsh
2019-03-05 15:54:02 -05:00
parent 2bbfb9514b
commit e1fe0cc030
236 changed files with 45339 additions and 7 deletions

View File

@@ -0,0 +1,51 @@
#include "LiveCodingServerModule.h"
#include "LiveCodingServer.h"
#include "Features/IModularFeatures.h"
#include "Modules/ModuleManager.h"
#include "External/LC_Logging.h"
IMPLEMENT_MODULE(FLiveCodingServerModule, LiveCodingServer)
static void ServerOutputHandler(logging::Channel::Enum Channel, logging::Type::Enum Type, const wchar_t* const Text)
{
ELiveCodingLogVerbosity Verbosity;
switch (Type)
{
case logging::Type::LOG_SUCCESS:
Verbosity = ELiveCodingLogVerbosity::Success;
break;
case logging::Type::LOG_ERROR:
Verbosity = ELiveCodingLogVerbosity::Failure;
break;
case logging::Type::LOG_WARNING:
Verbosity = ELiveCodingLogVerbosity::Warning;
break;
default:
Verbosity = ELiveCodingLogVerbosity::Info;
break;
}
GLiveCodingServer->GetLogOutputDelegate().ExecuteIfBound(Verbosity, Text);
}
void FLiveCodingServerModule::StartupModule()
{
logging::SetOutputHandler(&ServerOutputHandler);
GLiveCodingServer = new FLiveCodingServer();
IModularFeatures::Get().RegisterModularFeature(LIVE_CODING_SERVER_FEATURE_NAME, GLiveCodingServer);
}
void FLiveCodingServerModule::ShutdownModule()
{
IModularFeatures::Get().UnregisterModularFeature(LIVE_CODING_SERVER_FEATURE_NAME, GLiveCodingServer);
if(GLiveCodingServer != nullptr)
{
delete GLiveCodingServer;
GLiveCodingServer = nullptr;
}
logging::SetOutputHandler(nullptr);
}