// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using UnrealBuildBase;
namespace UnrealBuildTool
{
///
/// General deploy support functions, exported for UAT
///
public class DeployExports
{
///
/// The max length of the deploy folder name.
///
public const int DeployFolderMaxLength = 50;
///
/// Gets the default deploy folder name on the format ShortProjectName-RootDirectoryName-UserName,
/// truncated to DeployFolderMaxLength characters, with dots '.' and whitespace ' ' stripped.
///
/// Project to deploy
/// The default deploy folder name.
public static string GetDefaultDeployFolder(string ShortProjectName)
{
string DeployFolder = String.Format("{0}-{1}-{2}",
ShortProjectName,
Unreal.RootDirectory.GetDirectoryName(),
Environment.UserName);
DeployFolder = DeployFolder.Replace(" ", "");
DeployFolder = DeployFolder.Replace(".", "");
if (DeployFolder.Length > DeployFolderMaxLength)
{
DeployFolder = DeployFolder.Substring(0, DeployFolderMaxLength);
char[] CharsToTrim = { '-' };
DeployFolder = DeployFolder.Trim(CharsToTrim);
}
return DeployFolder;
}
}
}