// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using AutomationTool;
using EpicGames.Core;
using UnrealBuildTool;
namespace Gauntlet
{
///
/// Represents the configuration needed to run an instance of an Unreal app
///
public class UnrealAppConfig : IAppConfig
{
///
/// Reference name
///
public string Name { get; set; }
///
/// Name of this unreal project
///
public string ProjectName { get; set; }
//
/// Path to the file. Can be null if the project isn't on disk
///
public FileReference ProjectFile { get; set; }
///
/// Type of role this instance performs
///
public UnrealTargetRole ProcessType { get; set; }
///
/// Platform this role runs on
///
public UnrealTargetPlatform? Platform { get; set; }
///
/// Configuration for this role
///
public UnrealTargetConfiguration Configuration { get; set; }
///
/// Files to copy over to the device, plus what type of files they are.
///
public List FilesToCopy { get; set; }
///
/// Some IAppInstall instances can alter command line after it has been copied from AppConfig.CommandLine
/// Use this to restrict this behavior if necessary.
///
public bool CanAlterCommandArgs {
get { return CanAlterCommandArgsPrivate; }
set { CanAlterCommandArgsPrivate = value; }
}
private bool CanAlterCommandArgsPrivate = true;
///
/// Set this property when the application is executed through a Docker container.
///
public ContainerInfo ContainerInfo { get; set; }
///
/// Delegate to filter logging output
///
public LongProcessResult.OutputFilterCallbackType FilterLoggingDelegate { get; set; }
///
/// Arguments for this instance
///
public string CommandLine
{
get
{
if (CommandLineParams == null)
{
CommandLineParams = new GauntletCommandLine();
}
return CommandLineParams.GenerateFullCommandLine(CanAlterCommandArgs);
}
set
{
if (CommandLineParams == null)
{
CommandLineParams = new GauntletCommandLine();
}
CommandLineParams.ClearCommandLine();
CommandLineParams.AddRawCommandline(value, false);
}
}
///
/// Dictionary of commandline arguments that are turned into a commandline at the end.
/// For flags, leave the value set to null.
///
public GauntletCommandLine CommandLineParams;
///
/// Sandbox that we'd like to install this instance in
///
public string Sandbox { get; set; }
public IBuild Build { get; set; }
public OverlayExecutable OverlayExecutable{ get; set; }
// Prevents installing a build on device
public bool SkipInstall => DevicePool.SkipInstall;
// Performs a full clean on the device before installing
public bool FullClean => DevicePool.FullClean;
///
/// Use additional debug memory on target device if available.
///
public bool UsePlatformExtraDebugMemory { get; set; }
///
/// Defines the expected duration of the app process. May not be set depending on the context of this object's creation
///
public int MaxDuration { get; set; }
///
/// Constructor that sets some required values to defaults
///
public UnrealAppConfig()
{
Name = "UnrealApp";
ProjectName = "UnknownProject";
CommandLine = "";
Configuration = UnrealTargetConfiguration.Development;
Sandbox = "Gauntlet";
FilterLoggingDelegate = null;
}
}
}