diff options
author | Michael Hutchinson <mhutch@xamarin.com> | 2014-02-14 02:35:39 +0400 |
---|---|---|
committer | Michael Hutchinson <mhutch@xamarin.com> | 2014-02-14 10:45:51 +0400 |
commit | 01ec14902ff116a8cc4623e9310f55a6bbd9b67e (patch) | |
tree | e17f563cee3d607c9d6cb0ce792be2fd22f133b1 /main/src/core/MonoDevelop.Projects.Formats.MSBuild | |
parent | 90ce25d249a5ee7e622f835f0c0fff5bb978f032 (diff) |
[MSBuild] Log project file error to build output
Diffstat (limited to 'main/src/core/MonoDevelop.Projects.Formats.MSBuild')
3 files changed, 51 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildResult.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildResult.cs index 7cbfacee75..0c9af43e85 100644 --- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildResult.cs +++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildResult.cs @@ -61,5 +61,54 @@ namespace MonoDevelop.Projects.Formats.MSBuild public int EndColumnNumber { get; set; } public string Message { get; set; } public string HelpKeyword { get; set; } + + public override string ToString () + { + var sb = new StringBuilder (); + if (!string.IsNullOrEmpty (File)) { + sb.Append (File); + if (LineNumber > 0) { + //(line) + sb.Append ("("); + sb.Append (LineNumber); + if (ColumnNumber > 0) { + //(line,col) + sb.Append (","); + sb.Append (ColumnNumber); + if (EndColumnNumber > 0) { + if (EndLineNumber > 0) { + //(line,col,line,col) + sb.Append (","); + sb.Append (EndLineNumber); + sb.Append (","); + sb.Append (EndColumnNumber); + } else { + //(line,col-col) + sb.Append ("-"); + sb.Append (EndColumnNumber); + } + } + } else if (EndLineNumber > 0) { + //(line-line) + sb.Append ("-"); + sb.Append (EndLineNumber); + } + sb.Append (")"); + } + sb.Append (": "); + } + if (!string.IsNullOrEmpty (Subcategory)) { + sb.Append (Subcategory); + sb.Append (" "); + } + sb.Append (IsWarning ? "warning" : "error"); + if (!string.IsNullOrEmpty (Code)) { + sb.Append (" "); + sb.Append (Code); + } + sb.Append (": "); + sb.Append (Message); + return sb.ToString (); + } } } diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs index 7913085628..ee323e6cd8 100644 --- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs +++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs @@ -100,6 +100,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild file, false, ex.ErrorSubcategory, ex.ErrorCode, ex.ProjectFile, ex.LineNumber, ex.ColumnNumber, ex.EndLineNumber, ex.EndColumnNumber, ex.BaseMessage, ex.HelpKeyword); + logWriter.WriteLine (r.ToString ()); result = new [] { r }; } finally {
currentLogWriter = null;
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs index 7390081f7b..ef907cb758 100644 --- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs +++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs @@ -100,6 +100,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild file, false, ex.ErrorSubcategory, ex.ErrorCode, ex.ProjectFile,
ex.LineNumber, ex.ColumnNumber, ex.EndLineNumber, ex.EndColumnNumber,
ex.BaseMessage, ex.HelpKeyword);
+ logWriter.WriteLine (r.ToString ());
result = new [] { r };
} finally {
currentLogWriter = null;
|