Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/System/DeployExports.cs
PJ Kack 5d37548746 UAT: Change the default DeployFolder name to be ShortProjectName-RootFolderName-UserName truncated to 50 characters.
This will deploy the same project from different streams or users to to different workspaces.
Use the DeployFolder instead of the ShortProjectName for all platforms.
The existing -deploy=DeployFolder argument can be used to specify any custom workspace name.

#rb jeff.newquist

[CL 11041420 by PJ Kack in Dev-Core branch]
2020-01-17 04:36:41 -05:00

49 lines
1.4 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tools.DotNETCommon;
namespace UnrealBuildTool
{
/// <summary>
/// General deploy support functions, exported for UAT
/// </summary>
public class DeployExports
{
/// <summary>
/// The max length of the deploy folder name.
/// </summary>
public const int DeployFolderMaxLength = 50;
/// <summary>
/// Gets the default deploy folder name on the format ShortProjectName-RootDirectoryName-UserName,
/// truncated to DeployFolderMaxLength characters, with dots '.' and whitespace ' ' stripped.
/// </summary>
/// <param name="ShortProjectName">Project to deploy</param>
/// <returns>The default deploy folder name.</returns>
public static string GetDefaultDeployFolder(string ShortProjectName)
{
string DeployFolder = string.Format("{0}-{1}-{2}",
ShortProjectName,
UnrealBuildTool.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;
}
}
}