예제 #1
0
        private static bool OutputDiagnostics(Project project, FixedList <Diagnostic> diagnostics, object consoleLock)
        {
            if (!diagnostics.Any())
            {
                return(false);
            }
            lock (consoleLock)
            {
                Console.WriteLine($@"Build FAILED {project.Name} ({project.Path})");
                foreach (var group in diagnostics.GroupBy(d => d.File))
                {
                    var fileDiagnostics = @group.ToList();
                    foreach (var diagnostic in fileDiagnostics.Take(10))
                    {
                        Console.WriteLine(
                            $@"{diagnostic.File.Reference}:{diagnostic.StartPosition.Line}:{diagnostic.StartPosition.Column} {diagnostic.Level} {diagnostic.ErrorCode}");
                        Console.WriteLine(@"    " + diagnostic.Message);
                    }

                    if (fileDiagnostics.Count > 10)
                    {
                        Console.WriteLine($"{@group.Key.Reference}");
                        Console.WriteLine(
                            $"    {fileDiagnostics.Skip(10).Count(d => d.Level >= DiagnosticLevel.CompilationError)} more errors not shown.");
                        Console.WriteLine(
                            $"    {fileDiagnostics.Skip(10).Count(d => d.Level == DiagnosticLevel.Warning)} more warnings not shown.");
                    }
                }
            }

            return(true);
        }
예제 #2
0
        static private string ParseByThemeSummaryTable(string body,
                                                       FixedList <Activity> activities,
                                                       string tableRowTemplate)
        {
            string tableRows = String.Empty;

            var group = activities.GroupBy(x => x.Theme + MessagingUtilities.GetActivityRowColor(x)).OrderBy(y => y.Key);

            foreach (var item in activities)
            {
                //tableRows += ParseSummaryItem(tableRowTemplate, itemName, count, color);
            }

            return(body.Replace("{{ACTIVITIES-TABLE-ROWS}}", tableRows));
        }