2019-12-26 15:32:37 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2019-03-06 12:44:19 -05:00
|
|
|
|
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
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreTypes.h"
|
2019-08-28 12:34:28 -04:00
|
|
|
#include "Delegates/Delegate.h"
|
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
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
#include "Modules/ModuleInterface.h"
|
|
|
|
|
|
|
|
|
|
#define LIVE_CODING_MODULE_NAME "LiveCoding"
|
|
|
|
|
|
2021-10-13 13:18:44 -04:00
|
|
|
class FText;
|
|
|
|
|
|
2021-12-08 11:50:54 -05:00
|
|
|
enum class ELiveCodingCompileFlags : uint8
|
|
|
|
|
{
|
|
|
|
|
None = 0,
|
|
|
|
|
WaitForCompletion = 1 << 0,
|
|
|
|
|
};
|
|
|
|
|
ENUM_CLASS_FLAGS(ELiveCodingCompileFlags)
|
|
|
|
|
|
|
|
|
|
enum class ELiveCodingCompileResult : uint8
|
|
|
|
|
{
|
|
|
|
|
Success, // Compile completed and there were changes
|
|
|
|
|
NoChanges, // Compile completed and there were no changes
|
|
|
|
|
InProgress, // Compile started but wait for completion was not specified
|
|
|
|
|
CompileStillActive, // A prior compile request is still active
|
|
|
|
|
NotStarted, // Live coding monitor could not be started
|
|
|
|
|
Failure, // Complete completed but there was an error
|
|
|
|
|
Cancelled, // Compile was cancelled
|
|
|
|
|
};
|
|
|
|
|
|
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
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
class ILiveCodingModule : public IModuleInterface
|
|
|
|
|
{
|
|
|
|
|
public:
|
2022-10-20 09:21:20 -04:00
|
|
|
|
|
|
|
|
// Enable by default tracks the value in the live coding settings.
|
|
|
|
|
// If enabled by default and the startup mode is one of the automatic settings, then
|
|
|
|
|
// live coding console will be started when the module is started.
|
2019-03-11 18:57:53 -04:00
|
|
|
virtual void EnableByDefault(bool bEnabled) = 0;
|
|
|
|
|
virtual bool IsEnabledByDefault() const = 0;
|
2019-03-12 10:09:26 -04:00
|
|
|
|
2022-10-20 09:21:20 -04:00
|
|
|
// The enabled for session state and started state are NOT independent states.
|
|
|
|
|
// If a request is made to enabled live coding (automatically or manually) and live coding
|
|
|
|
|
// hasn't already been started, then it is started. If and only if the console starts
|
|
|
|
|
// will both the started state and the enabled for session state will be true.
|
|
|
|
|
// If enable for session is set to false, the console isn't stopped so the started state
|
|
|
|
|
// will remain true.
|
|
|
|
|
//
|
|
|
|
|
// Started = false, Enabled = false => no request to enable has ever been made or it failed to start
|
|
|
|
|
// Started = true, Enabled = true => a request to enable was made and it started properly
|
|
|
|
|
// Started = true, Enabled = false => has been started but later disabled
|
|
|
|
|
// Started = false, Enabled = true => impossible state.
|
|
|
|
|
virtual bool HasStarted() const = 0;
|
2019-03-11 18:57:53 -04:00
|
|
|
virtual void EnableForSession(bool bEnabled) = 0;
|
|
|
|
|
virtual bool IsEnabledForSession() const = 0;
|
2019-03-14 17:52:18 -04:00
|
|
|
virtual bool CanEnableForSession() const = 0;
|
2022-10-20 09:21:20 -04:00
|
|
|
|
2021-10-13 13:18:44 -04:00
|
|
|
virtual const FText& GetEnableErrorText() const = 0;
|
2021-06-17 08:47:50 -04:00
|
|
|
virtual bool AutomaticallyCompileNewClasses() const = 0;
|
2019-03-12 10:09:26 -04:00
|
|
|
|
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
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
virtual void ShowConsole() = 0;
|
2019-03-11 18:57:53 -04:00
|
|
|
virtual void Compile() = 0;
|
2021-12-08 11:50:54 -05:00
|
|
|
virtual bool Compile(ELiveCodingCompileFlags CompileFlags, ELiveCodingCompileResult* Result) = 0;
|
2019-03-07 17:30:35 -05:00
|
|
|
virtual bool IsCompiling() const = 0;
|
2019-03-07 15:21:21 -05:00
|
|
|
virtual void Tick() = 0;
|
2019-08-28 12:34:28 -04:00
|
|
|
|
|
|
|
|
DECLARE_MULTICAST_DELEGATE(FOnPatchCompleteDelegate);
|
|
|
|
|
virtual FOnPatchCompleteDelegate& GetOnPatchCompleteDelegate() = 0;
|
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
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
};
|
|
|
|
|
|