-
Notifications
You must be signed in to change notification settings - Fork 5
/
Project.cs
116 lines (96 loc) · 2.57 KB
/
Project.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Copyright © 2006 by Christian Rodemeyer (mailto:christian@atombrenner.de)
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Build.Framework;
namespace Rodemeyer.MsBuildToCCNet
{
internal class Project
{
internal Project(string file)
{
File = file;
errors = new List<Error>();
warnings = new List<Warning>();
messages = new List<Message>();
}
public readonly string File;
public IEnumerable<Error> Errors
{
get { return errors; }
}
private List<Error> errors;
public IEnumerable<Warning> Warnings
{
get { return warnings; }
}
private List<Warning> warnings;
public IEnumerable<Message> Messages
{
get { return messages; }
}
private List<Message> messages;
public int ErrorCount
{
get { return errors.Count; }
}
public int WarningCount
{
get { return warnings.Count; }
}
public int MessageCount
{
get { return messages.Count; }
}
public void Add(Error e)
{
errors.Add(e);
}
public void Add(Warning w)
{
warnings.Add(w);
}
public void Add(Message m)
{
messages.Add(m);
}
}
internal class ErrorOrWarningBase
{
protected ErrorOrWarningBase(string code, string text, string file, int line, int column)
{
Code = code;
Text = text;
File = file == "" ? null : file;
Line = line;
Column = column;
}
public readonly string Code;
public readonly string Text;
public readonly string File;
public readonly int Line;
public readonly int Column;
}
internal class Warning: ErrorOrWarningBase
{
public Warning(BuildWarningEventArgs e)
: base (e.Code, e.Message, e.File, e.LineNumber, e.ColumnNumber)
{}
}
internal class Error : ErrorOrWarningBase
{
public Error(BuildErrorEventArgs e)
: base(e.Code, e.Message, e.File, e.LineNumber, e.ColumnNumber)
{}
}
internal class Message
{
public Message(BuildMessageEventArgs e)
{
Importance = e.Importance;
Text = e.Message;
}
public readonly string Text;
public readonly MessageImportance Importance;
}
}