You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb Sebastian.Nordgren #rnx #jira UE-156436 #preflight 62c287f9a3568e30664eb94f ### VA Standalone Tool - We now plan to add much more functionality to the tool than just virtualizing and submitting changelists, so to make this easier I am moving the tool towards a design where it should be fairly easy to add new functionality. - Added FCommand, which is a base class for adding new functionality, simple derive from FCommand and hook it up at the appropriate locations. -- In the future it should be possible for new command types to automatically register themselves to be initiated from the command line. There should be no need to edit UnrealVirtualizationToolApp to add a new command but this will be done as an additional work item. -- At the moment FCommand comes with a number of utility methods to call that cover some common source control commands. -- The original functionality has not yet been moved to the command system and so the code is a little bit weird at the moment. Updating older code to the new system will be done as an additional work item. - FProject/FPlugin have been moved to their own code files. ### Rehydrate Command - The rehydrate command will take a number of packages, check them out of source control and then attempt to virtualize them. - At the moment the chekout logic is fairly basic, we just check out every package supplied, we don't check if the package is virtualized or not yet. This can be improved in additional work items. Ideally by the end of command the only packages that we have checked out should also be rehydrated. - At the moment the command can either take a path of a specific package, a path of a directory to find packages in, or a changelist containing packages that should be rehydrated. - A cleint spec (workspace) can optionally be provided, but if not supplied we will attempt to find a client spec for which to check out the packages. - Currently we will check out the packages to the default change list. ### Rehydrate process - Added the rehydration process in it's own code files in the virtualization module. Like the virtualization process this is exposed in a public header file and no via the Core interface which means it is very specific to our module/implementation. - The process expects that the caller will have checked out any required packages from source control. It will treat being unable to update a package file as an error. - Added PackageUtils.h/.cpp and moved some of the generic code from the virtualization process code there so that it can be shared by the rehydration process. ### Misc Moving away from the using things like FPackagePath as that requires that the correct mount points have been registered for a project and at the moment (with the flakiness of FConfig*) it seems that the best idea would be to prefer absolute file paths where possible. [CL 20982284 by paul chipchase in ue5-main branch]
128 lines
3.3 KiB
C++
128 lines
3.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Containers/Array.h"
|
|
#include "Containers/UnrealString.h"
|
|
#include "ISourceControlChangelist.h" // TODO
|
|
#include "ProjectFiles.h"
|
|
#include "Templates/UniquePtr.h"
|
|
|
|
class ISourceControlProvider;
|
|
|
|
namespace UE::Virtualization
|
|
{
|
|
|
|
class FCommand;
|
|
|
|
/** The mode of the application to run */
|
|
enum class EMode :uint32
|
|
{
|
|
/** Error condition */
|
|
Unknown = 0,
|
|
|
|
/// Virtualization
|
|
|
|
/** Virtualize and submit a given changelist */
|
|
Changelist,
|
|
/** Virtualize a list of packages provided by text file */
|
|
PackageList,
|
|
|
|
/// Rehydration
|
|
|
|
/** Rehydrate one or more packages */
|
|
Rehydrate,
|
|
};
|
|
|
|
// Note that the enum doesn't give us huge value right now, it has been provided
|
|
// in case that we expand with additional functionality in the future.
|
|
|
|
/** A bitfield of the various operations that the virtualization process supports */
|
|
enum class EProcessOptions : uint32
|
|
{
|
|
/** No options */
|
|
None = 0,
|
|
/** Virtualize the packages in the provided changelist */
|
|
Virtualize = 1 << 0,
|
|
/** Submit the changelist */
|
|
Submit = 1 << 1
|
|
};
|
|
ENUM_CLASS_FLAGS(EProcessOptions);
|
|
|
|
/** The result of FUnrealVirtualizationToolApp initialization */
|
|
enum class EInitResult
|
|
{
|
|
/** Initialization succeeded and the application should run. */
|
|
Success = 0,
|
|
/** No error was encountered but the application should early out and not run. */
|
|
EarlyOut,
|
|
/** Initialization failed with an error, we should not run and should display an error to the user */
|
|
Error
|
|
};
|
|
|
|
class FUnrealVirtualizationToolApp
|
|
{
|
|
public:
|
|
FUnrealVirtualizationToolApp();
|
|
~FUnrealVirtualizationToolApp();
|
|
|
|
EInitResult Initialize();
|
|
bool Run();
|
|
|
|
private:
|
|
|
|
void PrintCmdLineHelp() const;
|
|
|
|
bool TrySubmitChangelist(const TArray<FString>& DescriptionTags);
|
|
|
|
bool TryLoadModules();
|
|
bool TryInitEnginePlugins();
|
|
bool TryConnectToSourceControl();
|
|
|
|
EInitResult TryParseCmdLine();
|
|
EInitResult TryParseChangelistCmdLine(const TCHAR* CmdLine);
|
|
EInitResult TryParsePackageListCmdLine(const TCHAR* CmdLine);
|
|
|
|
bool TryParseChangelist(TArray<FString>& OutPackages);
|
|
bool TryParsePackageList(TArray<FString>& OutPackages);
|
|
|
|
bool TrySortFilesByProject(const TArray<FString>& Packages);
|
|
|
|
bool TryFindProject(const FString& PackagePath, FString& ProjectFilePath, FString& PluginFilePath) const;
|
|
|
|
FProject& FindOrAddProject(FString&& ProjectFilePath);
|
|
|
|
private:
|
|
|
|
/** Override used to suppress log messages */
|
|
TUniquePtr<FFeedbackContext> OutputDeviceOverride;
|
|
|
|
/** The source control provider that the tool uses */
|
|
TUniquePtr<ISourceControlProvider> SCCProvider;
|
|
|
|
/** Pointer to the changelist that should be submitted */
|
|
FSourceControlChangelistPtr ChangelistToSubmit;
|
|
|
|
/** Data structure holding the files in the changelist sorted by project and then by plugin*/
|
|
TArray<FProject> Projects;
|
|
|
|
/** Name of the client spec (workspace) passed in on the command line*/
|
|
FString ClientSpecName;
|
|
|
|
/** The mode for the application to run */
|
|
EMode Mode = EMode::Unknown;
|
|
|
|
/** Bitfield control the various options that should be run */
|
|
EProcessOptions ProcessOptions = EProcessOptions::Virtualize;
|
|
|
|
/** The number of the changelist being submitted, used with EMode::Changelist */
|
|
FString ChangelistNumber;
|
|
|
|
/** The path to the list of packages to virtualized, used with EMode::PackageList */
|
|
FString PackageListPath;
|
|
|
|
TUniquePtr<FCommand> CurrentCommand;
|
|
};
|
|
|
|
} //namespace UE::Virtualization
|