Bari.Core.Build.BuildContext.Dump C# (CSharp) Method

Dump() public method

Dumps the build context to dot files
public Dump ( Stream>.Func builderGraphStreamFactory, IBuilder rootBuilder ) : void
builderGraphStreamFactory Stream>.Func Stream factory to open named streams where the builder graphs will be dumped
rootBuilder IBuilder The root builder
return void
        public void Dump(Func<string, Stream> builderGraphStreamFactory, IBuilder rootBuilder)
        {
            var originalGraph = builders.ToAdjacencyGraph<IBuilder, EquatableEdge<IBuilder>>();
            originalGraph.RemoveEdgeIf(edge => edge.IsSelfEdge<IBuilder, EquatableEdge<IBuilder>>());
            using (var originalStream = builderGraphStreamFactory("original"))
                DumpGraph(originalStream, originalGraph);

            RunTransformations(builderGraphStreamFactory);

            var graph = builders.ToAdjacencyGraph<IBuilder, EquatableEdge<IBuilder>>();
            graph.RemoveEdgeIf(edge => edge.IsSelfEdge<IBuilder, EquatableEdge<IBuilder>>());

            if (rootBuilder != null)
                RemoveIrrelevantBranches(graph, rootBuilder);

            using (var finalStream = builderGraphStreamFactory("final"))
                DumpGraph(finalStream, graph);
        }