[svn] r7678: nemerle/trunk: Build-MSBuildTask.cmd tools/msbuild-task/MSBuildTask.n

VladD2 svnadmin at nemerle.org
Mon May 14 06:26:16 CEST 2007


Log:
Fix hint reporting in MSBuild.

Author: VladD2
Date: Mon May 14 06:26:14 2007
New Revision: 7678

Added:
   nemerle/trunk/Build-MSBuildTask.cmd
Modified:
   nemerle/trunk/tools/msbuild-task/MSBuildTask.n

Added: nemerle/trunk/Build-MSBuildTask.cmd
==============================================================================
--- (empty file)
+++ nemerle/trunk/Build-MSBuildTask.cmd	Mon May 14 06:26:14 2007
@@ -0,0 +1,15 @@
+IF NOT "%PROCESSOR_ARCHITECTURE%" == "x86" goto b64
+IF NOT "%PROCESSOR_ARCHITEW6432%" == "" goto b64
+set MSBuild=%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe
+goto b32
+:b64
+set MSBuild=%SystemRoot%\Microsoft.NET\Framework64\v2.0.50727\MSBuild.exe
+:b32
+
+ at echo MSBuild=%MSBuild%
+
+IF "%Type%"=="" set Type=Debug
+
+%MSBuild% Nemerle.MSBuild.Tasks.nproj /p:Configuration=%Type%
+
+ pause
\ No newline at end of file

Modified: nemerle/trunk/tools/msbuild-task/MSBuildTask.n
==============================================================================
--- nemerle/trunk/tools/msbuild-task/MSBuildTask.n	(original)
+++ nemerle/trunk/tools/msbuild-task/MSBuildTask.n	Mon May 14 06:26:14 2007
@@ -156,20 +156,24 @@
         }
       }
  
-      if (singleLine.IndexOf ("error:") != -1) {
-        def (file, l1, c1, l2, c2) = get_location ("error:");
-        Log.LogError (null, null, null, file, l1, c1, l2, c2, singleLine.Substring (singleLine.IndexOf ("error:") + 7));
-      }
-      else if (singleLine.IndexOf ("warning:") != -1) {
-        def (file, l1, c1, l2, c2) = get_location ("warning:");
-        Log.LogWarning (null, null, null, file, l1, c1, l2, c2, singleLine.Substring (singleLine.IndexOf ("warning:") + 9));
-      }
-      else if (singleLine.IndexOf ("debug:") != -1) {
-        def (file, l1, c1, l2, c2) = get_location ("debug:");
-        Log.LogError (null, null, null, file, l1, c1, l2, c2, singleLine.Substring (singleLine.IndexOf ("debug:") + 7));
+      def tryReport(tagStr, func)
+      {
+        def index = singleLine.IndexOf (tagStr);
+        if (index != -1)
+        {
+          def (file, l1, c1, l2, c2) = get_location (tagStr);
+          func (file, l1, c1, l2, c2, singleLine.Substring (index + if (tagStr == "hint:") 0 else tagStr.Length + 1));
+          true
       }
-      else 
-        _ = Log.LogMessageFromText(singleLine, MessageImportance.High);
+        else false
+      }
+
+      def logError  (file, l1, c1, l2, c2, msg) { Log.LogError   (null, null, null, file, l1, c1, l2, c2, msg) }
+      def logWarning(file, l1, c1, l2, c2, msg) { Log.LogWarning (null, null, null, file, l1, c1, l2, c2, msg) }
+
+      _ = tryReport ("error:", logError) || tryReport ("warning:", logWarning)
+       || tryReport ("debug:", logError) || tryReport ("hint:",    logWarning)
+       || Log.LogMessageFromText(singleLine, MessageImportance.High);
     }
 
     protected override GetResponseFileSwitch(responseFilePath : string) : string
@@ -177,6 +181,12 @@
       "/from-file:\"" + responseFilePath + "\"";
     }
 
+    /*protected override LogToolCommand(message : string) : void
+    {
+      _ = Log.LogMessageFromText("Command:", MessageImportance.Low);
+      _ = Log.LogMessageFromText(message, MessageImportance.Normal);
+    }*/
+
     [Accessor (flags = WantSetter)]
     mutable _disabled_warnings : array [string];
 



More information about the svn mailing list