Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Localization/LocalizationUtilities.cs
leon huang b3b7f0a6dc Localization:
Update the Localize UAT command to better handle gathering for plugins.
- Introduced the -IncludePluginsDirectory parameter to include all plugins under a particular directory
- Introduce the ExcludePluginsDirectory parameter to exclude all plugins under a particular directory
- Introduce the EnableIncludedPlugins flag to add all  included plugins that pass the exclude filter to the -EnablePlugins editor command line parameter to ensure the plugins are enabled for gathering.
#rb: Jamie.Dale
#jira: none
#test Used the new commands to perform gathers for directories of plugins and enabling plugins that are not on by default.

[CL 26161937 by leon huang in ue5-main branch]
2023-06-21 16:45:17 -04:00

54 lines
1.4 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System.Collections.Generic;
using System.IO;
using UnrealBuildTool;
using EpicGames.Core;
namespace EpicGames.Localization
{
public static class LocalizationUtilities
{
public static HashSet<string> GetPluginNamesUnderDirectory(string PluginDirectoryPath, string PluginRoot, PluginType Type)
{
HashSet<string> ReturnList = new HashSet<string>();
if (!Directory.Exists(PluginDirectoryPath))
{
return ReturnList;
}
if (!Directory.Exists(PluginRoot))
{
return ReturnList;
}
DirectoryReference PluginDirectoryReference = new DirectoryReference(PluginDirectoryPath);
DirectoryReference PluginRootDirectoryReference = new DirectoryReference(PluginRoot);
bool bIsSubdirectory = PluginDirectoryReference.IsUnderDirectory(PluginRootDirectoryReference);
if (bIsSubdirectory)
{
string RelativePath = PluginDirectoryReference.MakeRelativeTo(PluginRootDirectoryReference);
IReadOnlyList<PluginInfo> PluginsUnderDirectory = Plugins.ReadPluginsFromDirectory(PluginRootDirectoryReference, RelativePath, Type);
foreach (var Plugin in PluginsUnderDirectory)
{
ReturnList.Add(Plugin.Name);
}
}
return ReturnList;
}
public static string[] GetModularConfigSuffixes()
{
string[] FileSuffixes = {
"_Gather",
"_Import",
"_Export",
"_Compile",
"_GenerateReports",
};
return FileSuffixes;
}
}
}