2019-12-26 23:01:54 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
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 "LiveCodingConsole.h"
# include "RequiredProgramMainCPPInclude.h"
# include "Framework/Application/SlateApplication.h"
# include "StandaloneRenderer.h"
# include "LiveCodingConsoleStyle.h"
# include "HAL/PlatformProcess.h"
# include "SLogWidget.h"
# include "Modules/ModuleManager.h"
# include "ILiveCodingServer.h"
# include "Features/IModularFeatures.h"
# include "Widgets/Notifications/SNotificationList.h"
2020-12-11 14:21:20 -04:00
# include "Widgets/Input/SButton.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 "Framework/Notifications/NotificationManager.h"
# include "Windows/WindowsHWrapper.h"
# include "Misc/MonitoredProcess.h"
# include "LiveCodingManifest.h"
2020-08-11 01:36:57 -04:00
# include "SourceCodeAccess/Public/ISourceCodeAccessModule.h"
# include "Modules/ModuleInterface.h"
2020-10-09 14:56:26 -04:00
# include "Widgets/Input/SButton.h"
2020-12-08 09:47:08 -04:00
# include "Widgets/Input/SCheckBox.h"
# include "Widgets/Text/STextBlock.h"
# include "Misc/CompilationResult.h"
# include "Misc/MessageDialog.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
# define LOCTEXT_NAMESPACE "LiveCodingConsole"
IMPLEMENT_APPLICATION ( LiveCodingConsole , " LiveCodingConsole " ) ;
static void OnRequestExit ( )
{
2019-09-12 14:21:26 -04:00
RequestEngineExit ( TEXT ( " LiveCoding console closed " ) ) ;
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 FLiveCodingConsoleApp
{
private :
2021-10-12 11:10:41 -04:00
static constexpr TCHAR * SectionName = TEXT ( " LiveCodingConsole " ) ;
static constexpr TCHAR * DisableActionLimitKey = TEXT ( " bDisableActionLimit " ) ;
static constexpr TCHAR * ActionLimitKey = TEXT ( " ActionLimit " ) ;
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
FCriticalSection CriticalSection ;
FSlateApplication & Slate ;
ILiveCodingServer & Server ;
TSharedPtr < SLogWidget > LogWidget ;
TSharedPtr < SWindow > Window ;
TSharedPtr < SNotificationItem > CompileNotification ;
TArray < FSimpleDelegate > MainThreadTasks ;
bool bRequestCancel ;
2021-10-12 11:10:41 -04:00
bool bDisableActionLimit ;
2021-08-02 10:24:45 -04:00
bool bHasReinstancingProcess ;
2021-08-02 11:53:28 -04:00
bool bWarnOnRestart ;
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
FDateTime LastPatchTime ;
FDateTime NextPatchStartTime ;
public :
FLiveCodingConsoleApp ( FSlateApplication & InSlate , ILiveCodingServer & InServer )
: Slate ( InSlate )
, Server ( InServer )
, bRequestCancel ( false )
2021-10-12 11:10:41 -04:00
, bDisableActionLimit ( false )
2021-08-02 10:24:45 -04:00
, bHasReinstancingProcess ( false )
2021-08-02 11:53:28 -04:00
, bWarnOnRestart ( false )
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
, LastPatchTime ( FDateTime : : MinValue ( ) )
, NextPatchStartTime ( FDateTime : : MinValue ( ) )
{
}
void Run ( )
{
2021-10-12 11:10:41 -04:00
GConfig - > GetBool ( SectionName , DisableActionLimitKey , bDisableActionLimit , GEngineIni ) ;
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
// open up the app window
LogWidget = SNew ( SLogWidget ) ;
// Create the window
Window =
SNew ( SWindow )
. Title ( GetWindowTitle ( ) )
. ClientSize ( FVector2D ( 1200.0f , 600.0f ) )
. ActivationPolicy ( EWindowActivationPolicy : : Never )
. IsInitiallyMaximized ( false )
[
2019-07-16 08:46:52 -04:00
SNew ( SBorder )
. BorderImage ( FCoreStyle : : Get ( ) . GetBrush ( " ToolPanel.GroupBorder " ) )
[
SNew ( SVerticalBox )
+ SVerticalBox : : Slot ( )
. FillHeight ( 1.0f )
[
LogWidget . ToSharedRef ( )
]
+ SVerticalBox : : Slot ( )
. HAlign ( HAlign_Center )
. AutoHeight ( )
. Padding ( 0.0f , 6.0f , 0.0f , 4.0f )
[
2020-12-08 09:47:08 -04:00
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Center )
[
SNew ( SButton )
. Text ( LOCTEXT ( " QuickRestart " , " Quick Restart " ) )
. OnClicked ( FOnClicked : : CreateRaw ( this , & FLiveCodingConsoleApp : : RestartTargets ) )
2021-06-09 17:32:56 -04:00
. ToolTipText_Lambda ( [ this ] ( ) { return Server . HasReinstancingProcess ( ) ?
LOCTEXT ( " DisableQuickRestart " , " Quick restarting isn't supported when re-instancing is enabled " ) :
LOCTEXT ( " EnableQuickRestart " , " Restart all live coding applications " ) ; } )
2021-08-02 10:24:45 -04:00
. IsEnabled_Lambda ( [ this ] ( )
{
bool bNewState = Server . HasReinstancingProcess ( ) ;
if ( bNewState ! = bHasReinstancingProcess )
{
bHasReinstancingProcess = bNewState ;
if ( bHasReinstancingProcess )
{
LogWidget - > AppendLine ( GetLogColor ( ELiveCodingLogVerbosity : : Warning ) , TEXT ( " Quick restart disabled when re-instancing is enabled. " ) ) ;
}
else
{
LogWidget - > AppendLine ( GetLogColor ( ELiveCodingLogVerbosity : : Success ) , TEXT ( " Quick restart enabled. " ) ) ;
}
}
return ! bHasReinstancingProcess ;
} )
2020-12-08 09:47:08 -04:00
]
+ SHorizontalBox : : Slot ( )
. HAlign ( HAlign_Center )
. Padding ( 5 )
[
SNew ( SCheckBox )
2021-10-12 11:10:41 -04:00
. IsChecked_Lambda ( [ this ] ( ) { return bDisableActionLimit ? ECheckBoxState : : Checked : ECheckBoxState : : Unchecked ; } )
. OnCheckStateChanged_Lambda ( [ this ] ( ECheckBoxState InCheckBoxState )
{
bDisableActionLimit = InCheckBoxState = = ECheckBoxState : : Checked ;
GConfig - > SetBool ( SectionName , DisableActionLimitKey , bDisableActionLimit , GEngineIni ) ;
GConfig - > Flush ( false , GEngineIni ) ;
} )
2020-12-08 09:47:08 -04:00
[
SNew ( STextBlock )
. Text ( LOCTEXT ( " DisableLimit " , " Disable action limit for this session " ) )
]
]
2019-07-16 08:46:52 -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
] ;
// Add the window without showing it
Slate . AddWindow ( Window . ToSharedRef ( ) , false ) ;
// Show the window without stealling focus
if ( ! FParse : : Param ( FCommandLine : : Get ( ) , TEXT ( " Hidden " ) ) )
{
HWND ForegroundWindow = GetForegroundWindow ( ) ;
if ( ForegroundWindow ! = nullptr )
{
: : SetWindowPos ( ( HWND ) Window - > GetNativeWindow ( ) - > GetOSWindowHandle ( ) , ForegroundWindow , 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE ) ;
}
Window - > ShowWindow ( ) ;
}
// Get the server interface
Server . GetBringToFrontDelegate ( ) . BindRaw ( this , & FLiveCodingConsoleApp : : BringToFrontAsync ) ;
Server . GetLogOutputDelegate ( ) . BindRaw ( this , & FLiveCodingConsoleApp : : AppendLogLine ) ;
Server . GetShowConsoleDelegate ( ) . BindRaw ( this , & FLiveCodingConsoleApp : : BringToFrontAsync ) ;
Server . GetSetVisibleDelegate ( ) . BindRaw ( this , & FLiveCodingConsoleApp : : SetVisibleAsync ) ;
Server . GetCompileDelegate ( ) . BindRaw ( this , & FLiveCodingConsoleApp : : CompilePatch ) ;
Server . GetCompileStartedDelegate ( ) . BindRaw ( this , & FLiveCodingConsoleApp : : OnCompileStartedAsync ) ;
Server . GetCompileFinishedDelegate ( ) . BindLambda ( [ this ] ( ELiveCodingResult Result , const wchar_t * Message ) { OnCompileFinishedAsync ( Result , Message ) ; } ) ;
Server . GetStatusChangeDelegate ( ) . BindLambda ( [ this ] ( const wchar_t * Status ) { OnStatusChangedAsync ( Status ) ; } ) ;
// Start the server
FString ProcessGroupName ;
if ( FParse : : Value ( FCommandLine : : Get ( ) , TEXT ( " -Group= " ) , ProcessGroupName ) )
{
Server . Start ( * ProcessGroupName ) ;
Window - > SetRequestDestroyWindowOverride ( FRequestDestroyWindowOverride : : CreateLambda ( [ this ] ( const TSharedRef < SWindow > & ) { SetVisible ( false ) ; } ) ) ;
}
else
{
LogWidget - > AppendLine ( GetLogColor ( ELiveCodingLogVerbosity : : Warning ) , TEXT ( " Running in standalone mode. Server is disabled. " ) ) ;
}
// Setting focus seems to have to happen after the Window has been added
Slate . ClearKeyboardFocus ( EFocusCause : : Cleared ) ;
// loop until the app is ready to quit
2019-09-12 14:21:26 -04:00
while ( ! IsEngineExitRequested ( ) )
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
{
2020-10-29 13:38:15 -04:00
BeginExitIfRequested ( ) ;
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
Slate . PumpMessages ( ) ;
Slate . Tick ( ) ;
FPlatformProcess : : Sleep ( 1.0f / 30.0f ) ;
// Execute all the main thread tasks
FScopeLock Lock ( & CriticalSection ) ;
for ( FSimpleDelegate & MainThreadTask : MainThreadTasks )
{
MainThreadTask . Execute ( ) ;
}
MainThreadTasks . Empty ( ) ;
}
2021-10-12 11:10:41 -04:00
// NOTE: In normal operation, this is never reached. The window's JOB system will terminate the process.
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
// Make sure the window is hidden, because it might take a while for the background thread to finish.
Window - > HideWindow ( ) ;
// Shutdown the server
Server . Stop ( ) ;
}
private :
FText GetWindowTitle ( )
{
FString ProjectName ;
if ( FParse : : Value ( FCommandLine : : Get ( ) , TEXT ( " -ProjectName= " ) , ProjectName ) )
{
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " ProjectName " ) , FText : : FromString ( ProjectName ) ) ;
return FText : : Format ( LOCTEXT ( " WindowTitleWithProject " , " {ProjectName} - Live Coding " ) , Args ) ;
}
return LOCTEXT ( " WindowTitle " , " Live Coding " ) ;
}
void BringToFrontAsync ( )
{
FScopeLock Lock ( & CriticalSection ) ;
MainThreadTasks . Add ( FSimpleDelegate : : CreateRaw ( this , & FLiveCodingConsoleApp : : BringToFront ) ) ;
}
void BringToFront ( )
{
HWND WindowHandle = ( HWND ) Window - > GetNativeWindow ( ) - > GetOSWindowHandle ( ) ;
2019-03-07 13:42:02 -05:00
if ( IsIconic ( WindowHandle ) )
{
ShowWindow ( WindowHandle , SW_RESTORE ) ;
}
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
: : SetWindowPos ( WindowHandle , HWND_TOPMOST , 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE ) ;
: : SetWindowPos ( WindowHandle , HWND_NOTOPMOST , 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE ) ;
}
static FSlateColor GetLogColor ( ELiveCodingLogVerbosity Verbosity )
{
switch ( Verbosity )
{
case ELiveCodingLogVerbosity : : Success :
return FSlateColor ( FLinearColor : : Green ) ;
case ELiveCodingLogVerbosity : : Failure :
return FSlateColor ( FLinearColor : : Red ) ;
case ELiveCodingLogVerbosity : : Warning :
return FSlateColor ( FLinearColor : : Yellow ) ;
default :
return FSlateColor ( FLinearColor : : Gray ) ;
}
}
void AppendLogLine ( ELiveCodingLogVerbosity Verbosity , const TCHAR * Text )
{
// SLogWidget has its own synchronization
LogWidget - > AppendLine ( GetLogColor ( Verbosity ) , MoveTemp ( Text ) ) ;
}
2020-12-08 09:47:08 -04:00
ELiveCodingCompileResult CompilePatch ( const TArray < FString > & Targets , const TArray < FString > & ValidModules , TArray < FString > & RequiredModules , TMap < FString , TArray < FString > > & ModuleToObjectFiles , ELiveCodingCompileReason CompileReason )
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
{
// 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 ( ) ;
// Get the UBT path
2020-11-17 06:59:13 -04:00
FString Executable ;
FString Entry ;
if ( GConfig - > GetString ( TEXT ( " PlatformPaths " ) , TEXT ( " UnrealBuildTool " ) , Entry , GEngineIni ) )
{
2020-12-02 12:25:00 -04:00
Executable = FPaths : : ConvertRelativePathToFull ( FPaths : : RootDir ( ) / Entry ) ;
2020-11-17 06:59:13 -04:00
}
else
{
2021-04-28 10:09:28 -04:00
Executable = FPaths : : EngineDir ( ) / TEXT ( " Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.exe " ) ;
2020-11-17 06:59:13 -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
FPaths : : MakePlatformFilename ( Executable ) ;
2019-06-12 23:22:20 -04:00
// 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 ) ;
2021-10-12 21:21:22 -04:00
// Delete the output file for non-allowed modules
2019-06-12 23:22:20 -04:00
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 ) ;
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
// Build the argument list
FString Arguments ;
for ( const FString & Target : Targets )
{
Arguments + = FString : : Printf ( TEXT ( " -Target= \" %s \" " ) , * Target . Replace ( TEXT ( " \" " ) , TEXT ( " \" \" " ) ) ) ;
}
2019-06-12 23:22:20 -04:00
Arguments + = FString : : Printf ( TEXT ( " -LiveCoding -LiveCodingModules= \" %s \" -LiveCodingManifest= \" %s \" -WaitMutex " ) , * ModulesFileName , * ManifestFileName ) ;
2021-10-12 11:10:41 -04:00
if ( ! bDisableActionLimit & & CompileReason = = ELiveCodingCompileReason : : Initial )
2020-12-08 09:47:08 -04:00
{
2021-10-12 11:24:19 -04:00
int ActionLimit = 99 ;
2021-10-12 11:10:41 -04:00
GConfig - > GetInt ( SectionName , ActionLimitKey , ActionLimit , GEngineIni ) ;
if ( ActionLimit > 0 )
2020-12-08 09:47:08 -04:00
{
Arguments + = FString : : Printf ( TEXT ( " -LiveCodingLimit=%d " ) , ActionLimit ) ;
}
}
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
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 ) ;
2019-06-12 23:22:20 -04:00
Process . OnOutput ( ) . BindLambda ( [ this ] ( const FString & Text ) { AppendLogLine ( ELiveCodingLogVerbosity : : Info , * ( FString ( TEXT ( " " ) ) + Text ) ) ; } ) ;
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
Process . Launch ( ) ;
while ( Process . Update ( ) )
{
if ( HasCancelledBuild ( ) )
{
AppendLogLine ( ELiveCodingLogVerbosity : : Warning , TEXT ( " Build cancelled. " ) ) ;
2020-12-08 09:47:08 -04:00
return ELiveCodingCompileResult : : Canceled ;
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
}
FPlatformProcess : : Sleep ( 0.1f ) ;
}
2019-06-12 23:22:20 -04:00
int ReturnCode = Process . GetReturnCode ( ) ;
if ( ReturnCode ! = 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
{
2020-12-08 09:47:08 -04:00
ELiveCodingCompileResult CompileResult = ELiveCodingCompileResult : : Failure ;
// If there are missing modules, then we always retry them
2019-06-12 23:22:20 -04:00
if ( FPaths : : FileExists ( ModulesOutputFileName ) )
{
FFileHelper : : LoadFileToStringArray ( RequiredModules , * ModulesOutputFileName ) ;
2020-12-08 09:47:08 -04:00
if ( ! RequiredModules . IsEmpty ( ) )
{
CompileResult = ELiveCodingCompileResult : : Retry ;
}
2019-06-12 23:22:20 -04:00
}
2020-12-08 09:47:08 -04:00
// If we reached the live coding limit, the prompt the user to retry
if ( ReturnCode = = ECompilationResult : : LiveCodingLimitError )
{
const FText Message = LOCTEXT ( " LimitText " , " Live Coding action limit reached. Do you wish to compile anyway? \n \n "
2021-10-12 11:24:19 -04:00
" The limit can be permanently changed or disabled by setting the ActionLimit or DisableActionLimit setting for the LiveCodingConsole program. " ) ;
2020-12-08 09:47:08 -04:00
const FText Title = LOCTEXT ( " LimitTitle " , " Live Coding Action Limit Reached " ) ;
EAppReturnType : : Type ReturnType = FMessageDialog : : Open ( EAppMsgType : : YesNo , Message , & Title ) ;
CompileResult = ReturnType = = EAppReturnType : : Yes ? ELiveCodingCompileResult : : Retry : ELiveCodingCompileResult : : Canceled ;
}
if ( CompileResult = = ELiveCodingCompileResult : : Failure )
2019-06-12 23:22:20 -04:00
{
AppendLogLine ( ELiveCodingLogVerbosity : : Failure , TEXT ( " Build failed. " ) ) ;
}
2020-12-08 09:47:08 -04:00
return CompileResult ;
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
}
// Read the output manifest
FString ManifestFailReason ;
FLiveCodingManifest Manifest ;
if ( ! Manifest . Read ( * ManifestFileName , ManifestFailReason ) )
{
AppendLogLine ( ELiveCodingLogVerbosity : : Failure , * ManifestFailReason ) ;
2020-12-08 09:47:08 -04:00
return ELiveCodingCompileResult : : Failure ;
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
}
// Override the linker path
2019-04-04 12:02:05 -04:00
Server . SetLinkerPath ( * Manifest . LinkerPath , Manifest . LinkerEnvironment ) ;
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
// Strip out all the files that haven't been modified
IFileManager & FileManager = IFileManager : : Get ( ) ;
for ( TPair < FString , TArray < FString > > & Pair : Manifest . BinaryToObjectFiles )
{
FDateTime MinTimeStamp = FileManager . GetTimeStamp ( * Pair . Key ) ;
if ( LastPatchTime > MinTimeStamp )
{
MinTimeStamp = LastPatchTime ;
}
for ( const FString & ObjectFileName : Pair . Value )
{
if ( FileManager . GetTimeStamp ( * ObjectFileName ) > MinTimeStamp )
{
ModuleToObjectFiles . FindOrAdd ( Pair . Key ) . Add ( ObjectFileName ) ;
}
}
}
2020-12-08 09:47:08 -04:00
return ELiveCodingCompileResult : : Success ;
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
}
void CancelBuild ( )
{
FScopeLock Lock ( & CriticalSection ) ;
bRequestCancel = true ;
}
bool HasCancelledBuild ( )
{
FScopeLock Lock ( & CriticalSection ) ;
return bRequestCancel ;
}
2019-07-16 08:46:52 -04:00
FReply RestartTargets ( )
{
2021-08-02 11:53:28 -04:00
if ( bWarnOnRestart )
{
const FText Message = LOCTEXT ( " RestartWarningText " , " Restarting after patching while re-instancing was enabled can lead to unexpected results. \r \n \r \n Do you wish to continue? " ) ;
const FText Title = LOCTEXT ( " RestartWarningTitle " , " Restarting after patching while re-instancing was enabled? " ) ;
EAppReturnType : : Type ReturnType = FMessageDialog : : Open ( EAppMsgType : : YesNo , Message , & Title ) ;
if ( ReturnType ! = EAppReturnType : : Yes )
{
return FReply : : Handled ( ) ;
}
}
2019-07-16 08:46:52 -04:00
Server . RestartTargets ( ) ;
return FReply : : Handled ( ) ;
}
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
void SetVisibleAsync ( bool bVisible )
{
FScopeLock Lock ( & CriticalSection ) ;
MainThreadTasks . Add ( FSimpleDelegate : : CreateLambda ( [ this , bVisible ] ( ) { SetVisible ( bVisible ) ; } ) ) ;
}
void SetVisible ( bool bVisible )
{
if ( bVisible )
{
if ( ! Window - > IsVisible ( ) )
{
Window - > ShowWindow ( ) ;
}
}
else
{
if ( Window - > IsVisible ( ) )
{
Window - > HideWindow ( ) ;
}
}
}
2019-03-07 11:58:39 -05:00
void ShowConsole ( )
{
SetVisible ( true ) ;
BringToFront ( ) ;
}
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
void OnCompileStartedAsync ( )
{
FScopeLock Lock ( & CriticalSection ) ;
MainThreadTasks . Add ( FSimpleDelegate : : CreateRaw ( this , & FLiveCodingConsoleApp : : OnCompileStarted ) ) ;
bRequestCancel = false ;
NextPatchStartTime = FDateTime : : UtcNow ( ) ;
}
void OnCompileStarted ( )
{
if ( ! CompileNotification . IsValid ( ) )
{
2019-03-07 11:58:51 -05:00
ShowConsole ( ) ;
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
FNotificationInfo Info ( FText : : FromString ( TEXT ( " Starting... " ) ) ) ;
Info . bFireAndForget = false ;
Info . FadeOutDuration = 0.0f ;
Info . ExpireDuration = 0.0f ;
2019-03-07 11:58:39 -05:00
Info . Hyperlink = FSimpleDelegate : : CreateRaw ( this , & FLiveCodingConsoleApp : : ShowConsole ) ;
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
Info . HyperlinkText = LOCTEXT ( " BuildStatusShowConsole " , " Show Console " ) ;
Info . ButtonDetails . Add ( FNotificationButtonInfo ( LOCTEXT ( " BuildStatusCancel " , " Cancel " ) , FText ( ) , FSimpleDelegate : : CreateRaw ( this , & FLiveCodingConsoleApp : : CancelBuild ) , SNotificationItem : : CS_Pending ) ) ;
CompileNotification = FSlateNotificationManager : : Get ( ) . AddNotification ( Info ) ;
CompileNotification - > SetCompletionState ( SNotificationItem : : CS_Pending ) ;
}
}
void OnCompileFinishedAsync ( ELiveCodingResult Result , const FString & Status )
{
FScopeLock Lock ( & CriticalSection ) ;
MainThreadTasks . Add ( FSimpleDelegate : : CreateLambda ( [ this , Result , Status ] ( ) { OnCompileFinished ( Result , Status ) ; } ) ) ;
if ( Result = = ELiveCodingResult : : Success )
{
LastPatchTime = NextPatchStartTime ;
}
}
void OnCompileFinished ( ELiveCodingResult Result , const FString & Status )
{
if ( CompileNotification . IsValid ( ) )
{
2021-06-11 14:48:40 -04:00
if ( Result = = ELiveCodingResult : : Success )
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
{
2021-06-11 14:48:40 -04:00
if ( Server . ShowCompileFinishNotification ( ) )
{
CompileNotification - > SetText ( FText : : FromString ( Status ) ) ;
CompileNotification - > SetCompletionState ( SNotificationItem : : CS_Success ) ;
CompileNotification - > SetExpireDuration ( 1.5f ) ;
CompileNotification - > SetFadeOutDuration ( 0.4f ) ;
}
else
{
CompileNotification - > SetExpireDuration ( 0.0f ) ;
CompileNotification - > SetFadeOutDuration ( 0.1f ) ;
}
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
}
2021-06-11 14:48:40 -04:00
else if ( HasCancelledBuild ( ) )
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
{
CompileNotification - > SetExpireDuration ( 0.0f ) ;
CompileNotification - > SetFadeOutDuration ( 0.1f ) ;
}
else
{
2021-06-11 14:48:40 -04:00
if ( Server . ShowCompileFinishNotification ( ) )
{
CompileNotification - > SetText ( FText : : FromString ( Status ) ) ;
CompileNotification - > SetCompletionState ( SNotificationItem : : CS_Fail ) ;
CompileNotification - > SetExpireDuration ( 5.0f ) ;
CompileNotification - > SetFadeOutDuration ( 2.0f ) ;
}
else
{
CompileNotification - > SetExpireDuration ( 0.0f ) ;
CompileNotification - > SetFadeOutDuration ( 0.1f ) ;
ShowConsole ( ) ;
}
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
}
2021-06-11 14:48:40 -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
}
2021-06-11 14:48:40 -04:00
CompileNotification - > ExpireAndFadeout ( ) ;
CompileNotification . Reset ( ) ;
2021-08-02 11:53:28 -04:00
if ( Result = = ELiveCodingResult : : Success & & bHasReinstancingProcess )
{
bWarnOnRestart = true ;
}
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
}
void OnStatusChangedAsync ( const FString & Status )
{
FScopeLock Lock ( & CriticalSection ) ;
MainThreadTasks . Add ( FSimpleDelegate : : CreateLambda ( [ this , Status ] ( ) { OnCompileStatusChanged ( Status ) ; } ) ) ;
}
void OnCompileStatusChanged ( const FString & Status )
{
if ( CompileNotification . IsValid ( ) )
{
CompileNotification - > SetText ( FText : : FromString ( Status ) ) ;
}
}
} ;
bool LiveCodingConsoleMain ( const TCHAR * CmdLine )
{
// start up the main loop
GEngineLoop . PreInit ( CmdLine ) ;
check ( GConfig & & GConfig - > IsReadyForUse ( ) ) ;
2019-06-12 23:22:01 -04:00
// Initialize high DPI mode
FSlateApplication : : InitHighDPI ( true ) ;
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
{
2019-06-12 23:22:01 -04:00
// Create the platform slate application (what FSlateApplication::Get() returns)
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
TSharedRef < FSlateApplication > Slate = FSlateApplication : : Create ( MakeShareable ( FPlatformApplicationMisc : : CreateApplication ( ) ) ) ;
{
2019-06-12 23:22:01 -04:00
// Initialize renderer
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
TSharedRef < FSlateRenderer > SlateRenderer = GetStandardStandaloneRenderer ( ) ;
// Try to initialize the renderer. It's possible that we launched when the driver crashed so try a few times before giving up.
bool bRendererInitialized = Slate - > InitializeRenderer ( SlateRenderer , true ) ;
if ( ! bRendererInitialized )
{
// Close down the Slate application
FSlateApplication : : Shutdown ( ) ;
return false ;
}
2021-03-24 20:52:19 -04:00
// Set the normal UE IsEngineExitRequested() when outer frame is closed
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
Slate - > SetExitRequestedHandler ( FSimpleDelegate : : CreateStatic ( & OnRequestExit ) ) ;
// Prepare the custom Slate styles
FLiveCodingConsoleStyle : : Initialize ( ) ;
// Set the icon
2020-10-09 14:56:26 -04:00
FAppStyle : : SetAppStyleSet ( FLiveCodingConsoleStyle : : Get ( ) ) ;
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
2020-08-11 01:36:57 -04:00
// Load the source code access module
ISourceCodeAccessModule & SourceCodeAccessModule = FModuleManager : : LoadModuleChecked < ISourceCodeAccessModule > ( FName ( " SourceCodeAccess " ) ) ;
// Manually load in the source code access plugins, as standalone programs don't currently support plugins.
# if PLATFORM_MAC
IModuleInterface & XCodeSourceCodeAccessModule = FModuleManager : : LoadModuleChecked < IModuleInterface > ( FName ( " XCodeSourceCodeAccess " ) ) ;
SourceCodeAccessModule . SetAccessor ( FName ( " XCodeSourceCodeAccess " ) ) ;
# elif PLATFORM_WINDOWS
IModuleInterface & VisualStudioSourceCodeAccessModule = FModuleManager : : LoadModuleChecked < IModuleInterface > ( FName ( " VisualStudioSourceCodeAccess " ) ) ;
SourceCodeAccessModule . SetAccessor ( FName ( " VisualStudioSourceCodeAccess " ) ) ;
# endif
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
// Load the server module
2020-09-24 00:43:27 -04:00
FModuleManager : : Get ( ) . LoadModuleChecked < ILiveCodingServerModule > ( TEXT ( " LiveCodingServer " ) ) ;
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
ILiveCodingServer & Server = IModularFeatures : : Get ( ) . GetModularFeature < ILiveCodingServer > ( LIVE_CODING_SERVER_FEATURE_NAME ) ;
// Run the inner application loop
FLiveCodingConsoleApp App ( Slate . Get ( ) , Server ) ;
App . Run ( ) ;
// Unload the server module
FModuleManager : : Get ( ) . UnloadModule ( TEXT ( " LiveCodingServer " ) ) ;
// Clean up the custom styles
FLiveCodingConsoleStyle : : Shutdown ( ) ;
}
// Close down the Slate application
FSlateApplication : : Shutdown ( ) ;
}
FEngineLoop : : AppPreExit ( ) ;
FModuleManager : : Get ( ) . UnloadModulesAtShutdown ( ) ;
FEngineLoop : : AppExit ( ) ;
return true ;
}
int WINAPI WinMain ( HINSTANCE hCurrInstance , HINSTANCE hPrevInstance , LPSTR lpCmdLine , int nShowCmd )
{
hInstance = hCurrInstance ;
return LiveCodingConsoleMain ( GetCommandLineW ( ) ) ? 0 : 1 ;
}
# undef LOCTEXT_NAMESPACE