Files
UnrealEngineUWP/Engine/Source/Developer/DesktopPlatform/Public/TargetReceipt.h
ben marsh 6e9ae6e6fe Fix needing to manually enable building when launching projects from installed engine builds. Rather than relying solely on the engine promoted flag to determine whether a target should be built, we now check for the presence of a matching target receipt with the correct version information. If it's present, we don't trigger the build.
#rb none
#jira UE-89722, UE-90936

#ROBOMERGE-SOURCE: CL 12492552 in //UE4/Release-4.25/... via CL 12492554 via CL 12492556
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v673-12478461)

[CL 12492558 by ben marsh in Main branch]
2020-03-30 21:37:35 -04:00

116 lines
3.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Modules/BuildVersion.h"
/**
* Record of a file that was created as part of the build process
*/
struct FBuildProduct
{
/** Path to the file. */
FString Path;
/** Type of the build product. */
FString Type;
};
/**
* Information about a file which is required by the target at runtime, and must be moved around with it.
*/
struct FRuntimeDependency
{
/** The file that should be staged. Should use $(EngineDir) and $(ProjectDir) variables as a root, so that the target can be relocated to different machines. */
FString Path;
/** How to stage this file. */
FString Type;
};
/**
* Arbitrary property name/value which metadata from the build scripts can be passed on to downstream tasks
*/
struct FReceiptProperty
{
/** Property name */
FString Name;
/** Value of the property */
FString Value;
};
/**
* Stores information about a compiled target. Mirror of the TargetReceipt class generated by UBT.
*/
struct DESKTOPPLATFORM_API FTargetReceipt
{
/** Path to the project file for this target */
FString ProjectFile;
/** The project directory */
FString ProjectDir;
/** The name of this target */
FString TargetName;
/** Which platform the target is compiled for */
FString Platform;
/** Which platform the target is compiled for */
FString Architecture;
/** Which configuration this target is compiled in */
EBuildConfiguration Configuration;
/** The type of the target */
EBuildTargetType TargetType;
/** The version information for this target */
FBuildVersion Version;
/** The exectuable to launch for this target */
FString Launch;
/** The build products which are part of this target */
TArray<FBuildProduct> BuildProducts;
/** All the runtime dependencies that this target relies on */
TArray<FRuntimeDependency> RuntimeDependencies;
/** All plugins that were either enabled or disabled via the target rules. */
TMap<FString, bool> PluginNameToEnabledState;
/** Additional build properties passed through from the module rules */
TArray<FReceiptProperty> AdditionalProperties;
/**
* Read a target receipt from disk
*
* @param FileName The file to read from
* @return True if the file was read successfully
*/
bool Read(const FString& FileName);
/**
* Gets the default path for a target receipt
*
* @param BaseDir Base directory for the target being built; either the project directory or engine directory.
* @param TargetName The target being built
* @param Platform The target platform
* @param Configuration The target configuration
* @param BuildArchitecture The architecture being built
* @return Path to the receipt for this target
*/
static FString GetDefaultPath(const TCHAR* BaseDir, const TCHAR* TargetName, const TCHAR* Platform, EBuildConfiguration Configuration, const TCHAR* BuildArchitecture);
private:
/**
* Expands the $(EngineDir) and $(ProjectDir) variables within a string
*
* @param Path Path to expand variables within
*/
void ExpandVariables(FString& Path);
};