Files
UnrealEngineUWP/Engine/Source/Programs/UnrealVirtualizationTool/Private/UnrealVirtualizationTool.cpp
paul chipchase 6fc0764c07 First pass of a standalone tool that can be used to virtualize and submit a given changelist.
#rb PJ.Kack
#jira UE-147055
#preflight 623c401ec3399da9533f1b29

### Features
- Designed to be a custom tool in P4V although it can be called manually.
- The submit works just like the in editor package submission process.
- If the changelist being submitted contains packages from multiple projects the tool can virtualize each project's packages in a separate pass.

### Limitations
- Currently no way to auto install, this has to be compiled and set up manually
- The tool is written in cpp and uses engine code, this is so we can share the in editor code for pushing payloads and work with any additional backend plugins that 3rd parties may have written.
- If a changelist does not contain any packages, or the packages are in a project that does not support virtualization there will be a small amount of overhead while the tool works out that nothing needs to be done.

[CL 19493529 by paul chipchase in ue5-main branch]
2022-03-24 08:26:10 -04:00

55 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "UnrealVirtualizationTool.h"
#include "Modules/ModuleManager.h"
#include "RequiredProgramMainCPPInclude.h"
#include "UnrealVirtualizationToolApp.h"
IMPLEMENT_APPLICATION(UnrealVirtualizationTool, "UnrealVirtualizationTool");
DEFINE_LOG_CATEGORY(LogVirtualizationTool);
bool UnrealVirtualizationToolMain(int32 ArgC, TCHAR* ArgV[])
{
GEngineLoop.PreInit(ArgC, ArgV);
check(GConfig && GConfig->IsReadyForUse());
FModuleManager::Get().StartProcessingNewlyLoadedObjects();
bool bRanSuccessfully = true;
FUnrealVirtualizationToolApp App;
EInitResult Result = App.Initialize();
if (Result == EInitResult::Success)
{
if (!App.Run())
{
UE_LOG(LogVirtualizationTool, Error, TEXT("UnrealVirtualizationTool failed to run"));
bRanSuccessfully = false;
}
}
else if(Result == EInitResult::Error)
{
UE_LOG(LogVirtualizationTool, Error, TEXT("UnrealVirtualizationTool failed to initialize"));
bRanSuccessfully = false;
}
UE_CLOG(bRanSuccessfully, LogVirtualizationTool, Display, TEXT("UnrealVirtualizationTool ran successfully"));
// Even though we are exiting anyway we need to request an engine exit in order to get a clean shutdown
RequestEngineExit(TEXT("The process has finished"));
FEngineLoop::AppPreExit();
FModuleManager::Get().UnloadModulesAtShutdown();
FEngineLoop::AppExit();
return bRanSuccessfully;
}
INT32_MAIN_INT32_ARGC_TCHAR_ARGV()
{
FTaskTagScope Scope(ETaskTag::EGameThread);
return UnrealVirtualizationToolMain(ArgC, ArgV) ? 0 : 1;
}