Ignore empty AAR directories on Android (contributed by RPG3D)

#jira UE-88492
#PR #6676
#ue4
#android
#rb trivial

[CL 11520899 by Chris Babcock in 4.25 branch]
This commit is contained in:
RPG3D
2020-02-18 16:46:54 -05:00
committed by Chris Babcock
parent 0bb46f9ba0
commit b65e7beea4

View File

@@ -80,26 +80,33 @@ namespace UnrealBuildTool
/// <param name="SearchPattern">Search pattern to match</param>
public void AddRepositories(string RepositoryPath, string SearchPattern)
{
List<string> ToCheck = new List<string>();
ToCheck.Add(RepositoryPath);
while (ToCheck.Count > 0)
if (Directory.Exists(RepositoryPath))
{
int LastIndex = ToCheck.Count - 1;
string CurrentDir = ToCheck[LastIndex];
ToCheck.RemoveAt(LastIndex);
foreach (string SearchPath in Directory.GetDirectories(CurrentDir))
List<string> ToCheck = new List<string>();
ToCheck.Add(RepositoryPath);
while (ToCheck.Count > 0)
{
if (SearchPath.Contains(SearchPattern))
int LastIndex = ToCheck.Count - 1;
string CurrentDir = ToCheck[LastIndex];
ToCheck.RemoveAt(LastIndex);
foreach (string SearchPath in Directory.GetDirectories(CurrentDir))
{
Log.TraceInformation("Added repository: {0}", SearchPath);
Repositories.Add(SearchPath);
}
else
{
ToCheck.Add(SearchPath);
if (SearchPath.Contains(SearchPattern))
{
Log.TraceInformation("Added repository: {0}", SearchPath);
Repositories.Add(SearchPath);
}
else
{
ToCheck.Add(SearchPath);
}
}
}
}
else
{
Log.TraceInformation("AddRepositories: Directory {0} not found; ignored", RepositoryPath);
}
}
public void DumpAAR()