Show / Hide Table of Contents

Class DependencyGraph

Uses MSBuild to load and evaluate all projects from a set of project and/or solution paths on disk by recursively resolving any <ProjectReference> nodes. This class is immutable.

Inheritance
System.Object
DependencyGraph
Namespace: Xamarin.MSBuild.Sdk
Assembly: Xamarin.MSBuild.Sdk.dll
Syntax
public class DependencyGraph : object

Properties

| Improve this Doc View Source

ProjectCollection

The MSBuild collection of loaded projects. Until either LoadGraph(CancellationToken) or LoadGraphAsync(CancellationToken) is called the collection will be empty, but will populated with global properties.

Declaration
public ProjectCollection ProjectCollection { get; }
Property Value
Type Description
ProjectCollection
| Improve this Doc View Source

Relationships

A list of dependency relationships within the graph.

Declaration
public IReadOnlyList<> Relationships { get; }
Property Value
Type Description
IReadOnlyList<System.>
| Improve this Doc View Source

TopologicallySortedProjects

A topologically sorted list of loaded projects in ProjectCollection.

Declaration
public IReadOnlyList<ProjectDependencyNode> TopologicallySortedProjects { get; }
Property Value
Type Description
IReadOnlyList<ProjectDependencyNode>

Methods

| Improve this Doc View Source

Create(IEnumerable<String>, IEnumerable<KeyValuePair<String, String>>, DependencyGraph.ProjectCollectionFactory)

Declaration
public static DependencyGraph Create(IEnumerable<string> solutionOrProjectPaths, IEnumerable<KeyValuePair<string, string>> globalProperties, DependencyGraph.ProjectCollectionFactory projectCollectionFactory = null)
Parameters
Type Name Description
IEnumerable<System.String> solutionOrProjectPaths

The set of solution or projects paths to process.

IEnumerable<KeyValuePair<System.String, System.String>> globalProperties

Any global properties that should influence evaluation. May be null.

DependencyGraph.ProjectCollectionFactory projectCollectionFactory

A function that takes a set of global properties and returns an MSBuild ProjectCollection. This is particularly useful if any of the more advanced constructors for ProjectCollection are needed (such as for locating custom tool chains or to provide custom logging).

Returns
Type Description
DependencyGraph
| Improve this Doc View Source

Create(IEnumerable<String>, IEnumerable<>)

Declaration
public static DependencyGraph Create(IEnumerable<string> solutionOrProjectPaths, IEnumerable<> globalProperties = null)
Parameters
Type Name Description
IEnumerable<System.String> solutionOrProjectPaths

The set of solution or projects paths to process.

IEnumerable<System.> globalProperties

Any global properties that should influence evaluation.

Returns
Type Description
DependencyGraph
| Improve this Doc View Source

Create(IEnumerable<String>, [])

Declaration
public static DependencyGraph Create(IEnumerable<string> solutionOrProjectPaths, params[] globalProperties)
Parameters
Type Name Description
IEnumerable<System.String> solutionOrProjectPaths

The set of solution or projects paths to process.

System.[] globalProperties

Any global properties that should influence evaluation.

Returns
Type Description
DependencyGraph
| Improve this Doc View Source

Create(String, IEnumerable<>)

Declaration
public static DependencyGraph Create(string solutionOrProjectPath, IEnumerable<> globalProperties = null)
Parameters
Type Name Description
System.String solutionOrProjectPath

A solution or project path to process.

IEnumerable<System.> globalProperties

Any global properties that should influence evaluation.

Returns
Type Description
DependencyGraph
| Improve this Doc View Source

Create(String, [])

Declaration
public static DependencyGraph Create(string solutionOrProjectPath, params[] globalProperties)
Parameters
Type Name Description
System.String solutionOrProjectPath

A solution or project path to process.

System.[] globalProperties

Any global properties that should influence evaluation.

Returns
Type Description
DependencyGraph
| Improve this Doc View Source

GenerateVisualization(DependencyGraphVisualizationKind)

Declaration
public string GenerateVisualization(DependencyGraphVisualizationKind visualizationKind)
Parameters
Type Name Description
DependencyGraphVisualizationKind visualizationKind
Returns
Type Description
System.String
| Improve this Doc View Source

LoadGraph(CancellationToken)

Loads and fully resolves all projects in the full graph. This method may take some time (block) for large projects.

Declaration
public DependencyGraph LoadGraph(CancellationToken cancellationToken = null)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
DependencyGraph
| Improve this Doc View Source

LoadGraphAsync(CancellationToken)

Loads and fully resolves all projects in the full graph. This method may take some time for large projects and will be performed on the thread pool.

Declaration
public Task<DependencyGraph> LoadGraphAsync(CancellationToken cancellationToken = null)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<DependencyGraph>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX