[xbuild] Log default msg for TargetSkipped if @reason is null or empty.
authorAnkit Jain <radical@corewars.org>
Sat, 11 Sep 2010 18:14:36 +0000 (23:44 +0530)
committerAnkit Jain <radical@corewars.org>
Sat, 11 Sep 2010 18:20:02 +0000 (23:50 +0530)
mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs

index 54aad29da105d31c182d8d74da138b5acb28bda7..b5bc4599fdaf567084c61605456686714338a5c4 100644 (file)
@@ -241,8 +241,10 @@ namespace Microsoft.Build.BuildEngine {
                void LogTargetSkipped (Target target, string reason)
                {
                        BuildMessageEventArgs bmea;
-                       bmea = new BuildMessageEventArgs (reason ?? String.Format ("Skipping target \"{0}\" because its outputs are up-to-date.", target.Name),
-                               null, "MSBuild", MessageImportance.Normal);
+                       bmea = new BuildMessageEventArgs (String.IsNullOrEmpty (reason)
+                                                               ? String.Format ("Skipping target \"{0}\" because its outputs are up-to-date.", target.Name)
+                                                               : reason,
+                                                       null, "MSBuild", MessageImportance.Normal);
                        target.Engine.EventSource.FireMessageRaised (this, bmea);
                }