Esempio n. 1
0
        private IEnumerable <ProjectTreeElement> ScanProject(FullPath projectFullPath)
        {
            var treeState = new LoadTreeState();

            Queue <ProjectTreeElement> queue = new Queue <ProjectTreeElement>();

            var rootNode = AddProject(treeState, projectFullPath);

            queue.Enqueue(rootNode);

            while (queue.Count != 0)
            {
                var projectContainer = queue.Dequeue();
                _log.Info("Parsing project {0}", projectContainer.Path.Value);
                var modules = projectContainer.Project.Operations().AllModules;

                foreach (IModule module in modules)
                {
                    FullPath modulePath;
                    if (_path.TryResolveModulePath(projectContainer.Path, module.Path, out modulePath))
                    {
                        if (treeState.ScannedProjects.Any(item => item.Path.SameAs(modulePath)))
                        {
                            _log.Warning("Adding second instance of {0}", modulePath.Value);
                        }
                        else
                        {
                            var subProjectNode = AddProject(treeState, modulePath);
                            queue.Enqueue(subProjectNode);
                        }
                    }
                    else
                    {
                        _log.WriteMessage("Project: {0}, module is missing at {1}", projectContainer.Path, module.Path);
                    }
                }
            }

            return(treeState.ScannedProjects);
        }
Esempio n. 2
0
 public static void Warning(this IActionLog log, string messageFormat, params object[] args)
 {
     log.WriteMessage("WARNING:" + messageFormat, args);
 }
Esempio n. 3
0
 public static void Info(this IActionLog log, string messageFormat, params object[] args)
 {
     log.WriteMessage("INFO:" + messageFormat, args);
 }