Example #1
0
        public TrackedConfiguration(TrackedProject owningProject, Project.Configuration config)
        {
            _nodeVisited      = false;
            _owningProject    = owningProject;
            _dependenciesTo   = new SortedDictionary <TrackedConfiguration, Tuple <DependencyType, DependencySetting> >();
            _config           = config;
            _configOutputType = _config.Output;
            string cfgString = config.Owner != null?config.ToString() : owningProject.ToString();

            _configTypeName = cfgString.Substring(cfgString.IndexOf(':') + 1);
        }
Example #2
0
        private TrackedConfiguration FindConfiguration(Type project, ITarget config)
        {
            TrackedProject p = _projects[project.ToString()];

            return(p.FindConfiguration(config));
        }
Example #3
0
        private TrackedConfiguration FindConfiguration(Project project, Project.Configuration config)
        {
            TrackedProject p = _projects[project.ToString()];

            return(p.FindConfiguration(config));
        }
Example #4
0
        public void DumpGraphs(IDictionary <Type, GenerationOutput> outputs)
        {
            lock (this)
            {
                var dependencyOutput = outputs.GetValueOrAdd(typeof(DependencyTracker), new GenerationOutput());
                foreach (KeyValuePair <string, TrackedProject> pair in _projects)
                {
                    TrackedProject p = pair.Value;
                    foreach (KeyValuePair <string, TrackedConfiguration> confPair in p.Configurations)
                    {
                        TrackedConfiguration c = confPair.Value;
                        if (!c.DumpDependencyGraph())
                        {
                            continue;
                        }

                        string fileName = @"Dependencies ("
                                          + c.GetDisplayedName(false)
                                          + ", "
                                          + c.GetConfigName()
                                          + (DependencyTracker.ShowDependenciesFromExtern ? "" : " [excl from Extern]")
                                          + (DependencyTracker.ShowDependenciesToExtern ? "" : " [excl to Extern]")
                                          + ").gv";
                        // Open the stream and read it back.

                        MemoryStream memoryStream = new MemoryStream();
                        StreamWriter writer       = new StreamWriter(memoryStream);

                        writer.WriteLine("digraph g");
                        writer.WriteLine("{");

                        writer.WriteLine("graph [rankdir = \"TD\" bgcolor = \"lightblue:black\" style=\"filled\" gradientangle = 270 splines=true];");

                        WriteGraph(writer, c, "extStruct", false, false, () =>
                        {
                            foreach (KeyValuePair <string, TrackedProject> proj in _projects)
                            {
                                proj.Value.ResetVisit();
                            }
                        }
                                   );

                        if (GraphWriteLegend)
                        {
                            WriteLegend(writer);
                        }

                        writer.WriteLine("}");
                        writer.Flush();

                        var  outputFileInfo = new FileInfo(fileName);
                        bool written        = Builder.Instance.Context.WriteGeneratedFile(typeof(DependencyTracker), outputFileInfo, memoryStream);
                        if (written)
                        {
                            dependencyOutput.Generated.Add(outputFileInfo.FullName);
                        }
                        else
                        {
                            dependencyOutput.Skipped.Add(outputFileInfo.FullName);
                        }
                    }
                }
            }
        }