X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FMicrosoft.Build.Utilities%2FMicrosoft.Build.Utilities%2FTaskLoggingHelper.cs;h=11a9229539adb164159595e77069596f8d5aa672;hb=87928c86cb4ceed7b8af161f4d07121c0591bae9;hp=c098ba76c81d751320f05e1e90bbae6c7261300a;hpb=f99ce750ee781a2584e849a0264300fa4d99aaaa;p=mono.git diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs index c098ba76c81..11a9229539a 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs @@ -47,6 +47,7 @@ namespace Microsoft.Build.Utilities { if (taskInstance != null) this.buildEngine = taskInstance.BuildEngine; + taskName = null; } [MonoTODO] @@ -56,8 +57,8 @@ namespace Microsoft.Build.Utilities if (message == null) throw new ArgumentNullException ("message"); - messageWithoutCodePrefix = ""; - return ""; + messageWithoutCodePrefix = String.Empty; + return String.Empty; } [MonoTODO] @@ -77,7 +78,7 @@ namespace Microsoft.Build.Utilities if (unformatted == null) throw new ArgumentNullException ("unformatted"); - if (args == null) + if (args == null || args.Length == 0) return unformatted; else return String.Format (unformatted, args); @@ -101,7 +102,7 @@ namespace Microsoft.Build.Utilities throw new ArgumentNullException ("message"); BuildErrorEventArgs beea = new BuildErrorEventArgs ( - null, null, null, 0, 0, 0, 0, FormatString (message, messageArgs), + null, null, buildEngine.ProjectFileOfTaskNode, 0, 0, 0, 0, FormatString (message, messageArgs), helpKeywordPrefix, null); buildEngine.LogErrorEvent (beea); hasLoggedErrors = true; @@ -128,11 +129,18 @@ namespace Microsoft.Build.Utilities public void LogErrorFromException (Exception e) { - LogErrorFromException (e, false); + LogErrorFromException (e, true); } public void LogErrorFromException (Exception e, bool showStackTrace) + { + LogErrorFromException (e, showStackTrace, true, String.Empty); + } + + [MonoTODO ("Arguments @showDetail and @file are not honored")] + public void LogErrorFromException (Exception e, + bool showStackTrace, bool showDetail, string file) { if (e == null) throw new ArgumentNullException ("e"); @@ -142,7 +150,7 @@ namespace Microsoft.Build.Utilities if (showStackTrace == true) sb.Append (e.StackTrace); BuildErrorEventArgs beea = new BuildErrorEventArgs ( - null, null, null, 0, 0, 0, 0, sb.ToString (), + null, null, buildEngine.ProjectFileOfTaskNode, 0, 0, 0, 0, sb.ToString (), e.HelpLink, e.Source); buildEngine.LogErrorEvent (beea); hasLoggedErrors = true; @@ -213,10 +221,7 @@ namespace Microsoft.Build.Utilities if (message == null) throw new ArgumentNullException ("message"); - BuildMessageEventArgs bmea = new BuildMessageEventArgs ( - FormatString (message, messageArgs), helpKeywordPrefix, - null, importance); - buildEngine.LogMessageEvent (bmea); + LogMessageFromText (FormatString (message, messageArgs), importance); } public void LogMessageFromResources (string messageResourceName, @@ -269,13 +274,18 @@ namespace Microsoft.Build.Utilities stream.Close (); } } - - [MonoTODO] + public bool LogMessageFromText (string lineOfText, MessageImportance importance) { if (lineOfText == null) throw new ArgumentNullException ("lineOfText"); + + BuildMessageEventArgs bmea = new BuildMessageEventArgs ( + lineOfText, helpKeywordPrefix, + null, importance); + buildEngine.LogMessageEvent (bmea); + return true; } @@ -284,7 +294,7 @@ namespace Microsoft.Build.Utilities { // FIXME: what about all the parameters? BuildWarningEventArgs bwea = new BuildWarningEventArgs ( - null, null, null, 0, 0, 0, 0, FormatString (message, messageArgs), + null, null, buildEngine.ProjectFileOfTaskNode, 0, 0, 0, 0, FormatString (message, messageArgs), helpKeywordPrefix, null); buildEngine.LogWarningEvent (bwea); }