Listing runtime dependencies in module rules instead of InstalledEngineFilters.ini

Added code when filtering rocket files to search through build products for target files and add their runtime dependencies to the filter rules.

#jira UEB-372

[CL 2672116 by Matthew Griffin in Main branch]
This commit is contained in:
Matthew Griffin
2015-08-28 06:22:07 -04:00
committed by Matthew.Griffin@epicgames.com
parent 52722d49c4
commit ccd90b10b4
15 changed files with 134 additions and 49 deletions
@@ -964,6 +964,42 @@ namespace Rocket
throw new AutomationException("Couldn't find node '{0}'", NodeName);
}
Filter.AddRuleForFiles(Node.BuildProducts, CommandUtils.CmdEnv.LocalRoot, Type);
AddRuleForRuntimeDependencies(Filter, Node.BuildProducts, Type);
}
static void AddRuleForRuntimeDependencies(FileFilter Filter, List<string> BuildProducts, FileFilterType Type)
{
HashSet<string> RuntimeDependencyPaths = new HashSet<string>();
string EnginePath = CommandUtils.CombinePaths(CommandUtils.CmdEnv.LocalRoot, "Engine");
// Search for receipts in the Build Products
foreach (string BuildProduct in BuildProducts)
{
if (BuildProduct.EndsWith(".target"))
{
// Read the receipt
TargetReceipt Receipt;
if (!TargetReceipt.TryRead(BuildProduct, out Receipt))
{
//throw new AutomationException("Missing or invalid target receipt ({0})", BuildProduct);
continue;
}
// Convert the paths to absolute
Receipt.ExpandPathVariables(EnginePath, EnginePath);
foreach (var RuntimeDependency in Receipt.RuntimeDependencies)
{
RuntimeDependencyPaths.Add(RuntimeDependency.Path);
}
}
}
// Add rules for runtime dependencies if we found any
if (RuntimeDependencyPaths.Count > 0)
{
Filter.AddRuleForFiles(RuntimeDependencyPaths, CommandUtils.CmdEnv.LocalRoot, Type);
}
}
static void UnzipAndAddRuleForHeaders(string ZipFileName, FileFilter Filter, FileFilterType Type)