Files
UnrealEngineUWP/Engine/Source/Editor/VirtualizationEditor/Private/CheckForVirtualizedContentCommandlet.h
paul chipchase 4a9de4ab1b The VA commandlet 'ValidateVirtualizedContent' now iterates over all packages in a project and makes sure that any virtualized payloads encountered can be found in persistent storage. The original version of this commandlet has been renamed to 'CheckForVirtualizedContent' and continues to be used to make sure that virtualized packages do not get submitted to places that they should not.
#rb trivial
#jira UE-176611
#preflight 63fe18fcf43e53f68189d869

- Renamed UValidateVirtualizedContentCommandlet to UCheckForVirtualizedContentCommandlet. P4 rename was not done because I wanted to repurpose UValidateVirtualizedContentCommandlet and adding new versions of the code files after renaming them is likely to cause weird p4 merge issues in the future.

[CL 24442899 by paul chipchase in ue5-main branch]
2023-02-28 10:48:04 -05:00

52 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Commandlets/Commandlet.h"
#include "UObject/ObjectMacros.h"
#include "CheckForVirtualizedContentCommandlet.generated.h"
/**
* Used to validate that content does not contain virtualized payloads. The current
* cmdline options are:
* -CheckEngine
* Checks all packages currently mounted in the engine
* -CheckProject
* Checks all packages currently mounted in the current project
* -CheckDir=XYZ (XYZ is the path to the directory, use '+' as the delimiter if supplying
* more than one path)
* Checks packages in the given directory and all subdirectories
* any or all of which can be passed to the commandlet.
*
* If virtualized payloads are found then the package path (or file path if CheckDir
* indicates a directory that is not currently mounted by the project) is logged
* as an error and the commandlet will eventually return 1 as a failure value.
*
* Because the commandlet is the VirtualizationEditor module it needs to be invoked
* with the command line:
* -run=VirtualizationEditor.CheckForVirtualizedContent
*
* Followed by
*/
UCLASS()
class UCheckForVirtualizedContentCommandlet
: public UCommandlet
{
GENERATED_UCLASS_BODY()
//~ Begin UCommandlet Interface
virtual int32 Main(const FString& Params) override;
//~ End UCommandlet Interface
static int32 StaticMain(const FString& Params);
private:
TArray<FString> FindVirtualizedPackages(const TArray<FString>& PackagePaths);
bool TryValidateContent(const TCHAR* DebugName, const TArray<FString>& Packages);
bool TryValidateDirectory(const FString& Directory);
};