Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/Configuration/UEBuildPlugin.cs
ben marsh 1a0aebe5be UBT: Add a mode for analyzing the dependencies between modules.
Example usage "-Mode=Analyze UnrealEditor Win64 Development".

The tool currently outputs the following files:
* A graph of dependencies between modules, with edges indicating unique outward references (eg. if module A depends on Core and BuildSettings, but Core depends on BuildSettings, an edge will only be shown from A -> Core).
* A graph showing shortest path from the target to each module.
* A text file listing all modules in the target, their references to other modules, the shortest path causing them to be instantiated, and a (very) rough estimate of their size taken by measuring the sum of all object files or output files that already exist on disk.
* A csv file containing the same information as above.

Graphs are output in GEFX format, and can be viewed using Gephi.

[FYI] Mark.Lintott

#ROBOMERGE-AUTHOR: ben.marsh
#ROBOMERGE-SOURCE: CL 17473130 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17473153 by ben marsh in ue5-release-engine-test branch]
2021-09-09 12:12:20 -04:00

116 lines
2.6 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 EpicGames.Core;
namespace UnrealBuildTool
{
/// <summary>
/// Stores information about a plugin that is being built for a target
/// </summary>
class UEBuildPlugin
{
/// <summary>
/// Information about the plugin
/// </summary>
public PluginInfo Info;
/// <summary>
/// Modules that this plugin belongs to
/// </summary>
public List<UEBuildModuleCPP> Modules = new List<UEBuildModuleCPP>();
/// <summary>
/// Recursive
/// </summary>
public HashSet<UEBuildPlugin>? Dependencies;
/// <summary>
/// Whether the descriptor for this plugin is needed at runtime; because it has modules or content which is used, or because it references another module that does.
/// </summary>
public bool bDescriptorNeededAtRuntime;
/// <summary>
/// Whether this descriptor is referenced non-optionally by something else; a project file or other plugin. This is recursively applied to the plugin's references.
/// </summary>
public bool bDescriptorReferencedExplicitly;
/// <summary>
/// Chain of references to this plugin
/// </summary>
public string ReferenceChain;
/// <summary>
/// Constructor
/// </summary>
/// <param name="Info">The static plugin information</param>
/// <param name="ReferenceChain">Chain of references to this plugin</param>
public UEBuildPlugin(PluginInfo Info, string ReferenceChain)
{
this.Info = Info;
this.ReferenceChain = ReferenceChain;
}
/// <summary>
/// Accessor for the name of this plugin
/// </summary>
public string Name
{
get { return Info.Name; }
}
/// <summary>
/// Accessor for the file for this plugin
/// </summary>
public FileReference File
{
get { return Info.File; }
}
/// <summary>
/// Accessor for the child files for this plugin
/// </summary>
public List<FileReference> ChildFiles
{
get { return Info.ChildFiles; }
}
/// <summary>
/// Accessor for the type of the plugin
/// </summary>
public PluginType Type
{
get { return Info.Type; }
}
/// <summary>
/// Accessor for this plugin's root directory
/// </summary>
public DirectoryReference Directory
{
get { return Info.Directory; }
}
/// <summary>
/// Accessor for this plugin's descriptor
/// </summary>
public PluginDescriptor Descriptor
{
get { return Info.Descriptor; }
}
/// <summary>
/// Returns the name of this plugin for debugging
/// </summary>
/// <returns>Name of the plugin</returns>
public override string ToString()
{
return Info.Name;
}
}
}