コード例 #1
0
        private bool CheckProjects(TextWriter textWriter, Dictionary <ProjectKey, SolutionProjectData> map)
        {
            var solutionMap = new Dictionary <ProjectKey, ProjectData>();

            foreach (var pair in map)
            {
                solutionMap.Add(pair.Key, pair.Value.ProjectData);
            }

            var allGood = true;
            var count   = 0;

            foreach (var data in map.Values.OrderBy(x => x.ProjectEntry.Name))
            {
                var projectWriter = new StringWriter();
                var projectData   = data.ProjectData;
                projectWriter.WriteLine($"Processing {projectData.Key.FileName}");
                var util = new ProjectCheckerUtil(projectData, solutionMap);
                if (!util.Check(projectWriter))
                {
                    allGood = false;
                    textWriter.WriteLine(projectWriter.ToString());
                }
                count++;
            }

            textWriter.WriteLine($"Processed {count} projects");
            return(allGood);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: jkotas/roslyn
        private static bool ProcessProject(string solutionPath, ProjectData projectData, Dictionary<ProjectKey, ProjectData> map)
        {
            var util = new ProjectCheckerUtil(projectData, map);
            var textWriter = new StringWriter();
            if (!util.CheckAll(textWriter))
            {
                Console.WriteLine($"Checking {projectData.FilePath} failed");
                Console.WriteLine(textWriter.ToString());
                return false;
            }

            return true;
        }
コード例 #3
0
        public bool Check(TextWriter textWriter)
        {
            var solutionPath    = Path.GetDirectoryName(_solutionFilePath);
            var projectDataList = SolutionUtil.ParseProjects(_solutionFilePath);
            var map             = new Dictionary <ProjectKey, ProjectData>();
            var allGood         = true;

            foreach (var projectEntry in projectDataList)
            {
                if (projectEntry.IsFolder)
                {
                    continue;
                }

                // TODO: temporary work around util a cross cutting change can be sync'd up.
                if (Path.GetFileName(projectEntry.RelativeFilePath) == "CompilerPerfTest.vbproj")
                {
                    continue;
                }

                var projectFilePath = Path.Combine(solutionPath, projectEntry.RelativeFilePath);
                var projectData     = new ProjectData(projectFilePath);
                if (map.ContainsKey(projectData.Key))
                {
                    textWriter.WriteLine($"Duplicate project detected {projectData.FileName}");
                    allGood = false;
                }
                else
                {
                    map.Add(projectData.Key, projectData);
                }
            }

            var count = 0;

            foreach (var projectData in map.Values.OrderBy(x => x.FileName))
            {
                var projectWriter = new StringWriter();
                projectWriter.WriteLine($"Processing {projectData.Key.FileName}");
                var util = new ProjectCheckerUtil(projectData, map);
                if (!util.Check(projectWriter))
                {
                    allGood = false;
                    textWriter.WriteLine(projectWriter.ToString());
                }
                count++;
            }

            textWriter.WriteLine($"Processed {count} projects");
            return(allGood);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: aa10000/roslyn
        private static bool ProcessProject(string solutionPath, ProjectData projectData, Dictionary <ProjectKey, ProjectData> map)
        {
            var util       = new ProjectCheckerUtil(projectData, map);
            var textWriter = new StringWriter();

            if (!util.CheckAll(textWriter))
            {
                Console.WriteLine($"Checking {projectData.FilePath} failed");
                Console.WriteLine(textWriter.ToString());
                return(false);
            }

            return(true);
        }
コード例 #5
0
        public bool Check(TextWriter textWriter)
        {
            var solutionPath = Path.GetDirectoryName(_solutionFilePath);
            var projectDataList = SolutionUtil.ParseProjects(_solutionFilePath);
            var map = new Dictionary<ProjectKey, ProjectData>();
            foreach (var projectEntry in projectDataList)
            {
                if (projectEntry.IsFolder)
                {
                    continue;
                }

                // TODO: temporary work around util a cross cutting change can be sync'd up.  
                if (Path.GetFileName(projectEntry.RelativeFilePath) == "CompilerPerfTest.vbproj")
                {
                    continue;
                }

                var projectFilePath = Path.Combine(solutionPath, projectEntry.RelativeFilePath);
                var projectData = new ProjectData(projectFilePath);
                map.Add(projectData.Key, projectData);
            }

            var allGood = true;
            var count = 0;
            foreach (var projectData in map.Values.OrderBy(x => x.FileName))
            {
                var projectWriter = new StringWriter();
                projectWriter.WriteLine($"Processing {projectData.Key.FileName}");
                var util = new ProjectCheckerUtil(projectData, map);
                if (!util.Check(projectWriter))
                {
                    allGood = false;
                    textWriter.WriteLine(projectWriter.ToString());
                }
                count++;
            }

            textWriter.WriteLine($"Processed {count} projects");
            return allGood;
        }