Files
UnrealEngineUWP/Engine/Source/Developer/Windows/LiveCoding/Private/LiveCodingModule.h

63 lines
1.7 KiB
C
Raw Normal View History

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-OWNER: ben.marsh #ROBOMERGE-AUTHOR: ben.marsh #ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/... via CL 5309051 #ROBOMERGE-BOT: BUILD (Main -> Dev-Build) [CL 5325555 by ben marsh in Dev-Build branch]
2019-03-06 18:16:41 -05:00
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ILiveCodingModule.h"
#include "Delegates/Delegate.h"
#include "Modules/ModuleManager.h"
#include "Templates/SharedPointer.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-OWNER: ben.marsh #ROBOMERGE-AUTHOR: ben.marsh #ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/... via CL 5309051 #ROBOMERGE-BOT: BUILD (Main -> Dev-Build) [CL 5325555 by ben marsh in Dev-Build branch]
2019-03-06 18:16:41 -05:00
struct IConsoleCommand;
class IConsoleVariable;
class ISettingsSection;
class ULiveCodingSettings;
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-OWNER: ben.marsh #ROBOMERGE-AUTHOR: ben.marsh #ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/... via CL 5309051 #ROBOMERGE-BOT: BUILD (Main -> Dev-Build) [CL 5325555 by ben marsh in Dev-Build branch]
2019-03-06 18:16:41 -05:00
class FLiveCodingModule final : public ILiveCodingModule
{
public:
FLiveCodingModule();
// IModuleInterface implementation
virtual void StartupModule() override;
virtual void ShutdownModule() override;
// ILiveCodingModule implementation
virtual void EnableByDefault(bool bInEnabled) override;
virtual bool IsEnabledByDefault() const override;
virtual void EnableForSession(bool bInEnabled) override;
virtual bool IsEnabledForSession() const override;
virtual bool CanEnableForSession() const override;
virtual bool HasStarted() const override;
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-OWNER: ben.marsh #ROBOMERGE-AUTHOR: ben.marsh #ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/... via CL 5309051 #ROBOMERGE-BOT: BUILD (Main -> Dev-Build) [CL 5325555 by ben marsh in Dev-Build branch]
2019-03-06 18:16:41 -05:00
virtual void ShowConsole() override;
virtual void Compile() override;
virtual bool IsCompiling() const override;
virtual void Tick() override;
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-OWNER: ben.marsh #ROBOMERGE-AUTHOR: ben.marsh #ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/... via CL 5309051 #ROBOMERGE-BOT: BUILD (Main -> Dev-Build) [CL 5325555 by ben marsh in Dev-Build branch]
2019-03-06 18:16:41 -05:00
private:
ULiveCodingSettings* Settings;
TSharedPtr<ISettingsSection> SettingsSection;
bool bEnabledLastTick;
bool bEnabledForSession;
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-OWNER: ben.marsh #ROBOMERGE-AUTHOR: ben.marsh #ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/... via CL 5309051 #ROBOMERGE-BOT: BUILD (Main -> Dev-Build) [CL 5325555 by ben marsh in Dev-Build branch]
2019-03-06 18:16:41 -05:00
bool bStarted;
TSet<FName> ConfiguredModules;
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-OWNER: ben.marsh #ROBOMERGE-AUTHOR: ben.marsh #ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/... via CL 5309051 #ROBOMERGE-BOT: BUILD (Main -> Dev-Build) [CL 5325555 by ben marsh in Dev-Build branch]
2019-03-06 18:16:41 -05:00
const FString FullEnginePluginsDir;
const FString FullProjectDir;
const FString FullProjectPluginsDir;
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-OWNER: ben.marsh #ROBOMERGE-AUTHOR: ben.marsh #ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/... via CL 5309051 #ROBOMERGE-BOT: BUILD (Main -> Dev-Build) [CL 5325555 by ben marsh in Dev-Build branch]
2019-03-06 18:16:41 -05:00
IConsoleCommand* EnableCommand;
IConsoleVariable* ConsolePathVariable;
FDelegateHandle EndFrameDelegateHandle;
FDelegateHandle ModulesChangedDelegateHandle;
bool StartLiveCoding();
void OnModulesChanged(FName ModuleName, EModuleChangeReason Reason);
void UpdateModules();
void ConfigureModule(const FName& Name, const FString& FullFilePath);
bool ShouldPreloadModule(const FName& Name, const FString& FullFilePath) const;
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-OWNER: ben.marsh #ROBOMERGE-AUTHOR: ben.marsh #ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/... via CL 5309051 #ROBOMERGE-BOT: BUILD (Main -> Dev-Build) [CL 5325555 by ben marsh in Dev-Build branch]
2019-03-06 18:16:41 -05:00
};