Merge pull request #1506 from akoeplinger/fix-paste-test
[mono.git] / mcs / class / Microsoft.Build.Tasks / Microsoft.Build.Tasks / Vbc.cs
index 52a8da8f978be79bc86ba0e2a173806d064435ec..bc3a5fbd15e28492432797d72828bc09af43db7f 100644 (file)
@@ -26,7 +26,6 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-#if NET_2_0
 
 using System;
 using System.IO;
@@ -35,6 +34,7 @@ using System.Text.RegularExpressions;
 
 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;
+using Mono.XBuild.Utilities;
 
 namespace Microsoft.Build.Tasks {
 
@@ -140,7 +140,9 @@ namespace Microsoft.Build.Tasks {
                [MonoTODO]
                protected override string GenerateFullPathToTool ()
                {
-                       return Path.Combine (ToolPath, ToolExe);
+                       if (!string.IsNullOrEmpty (ToolPath))
+                               return Path.Combine (ToolPath, ToolExe);
+                       return ToolLocationHelper.GetPathToDotNetFrameworkFile (ToolExe, TargetDotNetFrameworkVersion.VersionLatest);
                }
                
                [MonoTODO]
@@ -155,7 +157,7 @@ namespace Microsoft.Build.Tasks {
                        return true;
                }
 
-               protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
+               protected override void LogEventsFromTextOutput (string singleLine, MessageImportance messageImportance)
                {
                        singleLine = singleLine.Trim ();
                        if (singleLine.Length == 0)
@@ -170,7 +172,7 @@ namespace Microsoft.Build.Tasks {
 
                        Match match = ErrorRegex.Match (singleLine);
                        if (!match.Success) {
-                               Log.LogMessage (importance, singleLine);
+                               Log.LogMessage (messageImportance, singleLine);
                                return;
                        }
 
@@ -182,7 +184,7 @@ namespace Microsoft.Build.Tasks {
                        string col = match.Result ("${column}");
                        int columnNumber = 0;
                        if (!string.IsNullOrEmpty (col))
-                               columnNumber = col == "255+" ? -1 : Int32.Parse (col);
+                               columnNumber = col.IndexOf ("+") >= 0 ? -1 : Int32.Parse (col);
 
                        string category = match.Result ("${level}");
                        string code = match.Result ("${number}");
@@ -195,7 +197,7 @@ namespace Microsoft.Build.Tasks {
                                Log.LogError (null, code, null, filename, lineNumber, columnNumber, -1,
                                        -1, text, null);
                        } else {
-                               Log.LogMessage (importance, singleLine);
+                               Log.LogMessage (messageImportance, singleLine);
                        }
                }
 
@@ -303,7 +305,9 @@ namespace Microsoft.Build.Tasks {
 
                [MonoTODO]
                protected override string ToolName {
-                       get { return Utilities.RunningOnWindows ? "vbnc.bat" : "vbnc"; }
+                       get {
+                               return MSBuildUtils.RunningOnWindows ? "vbnc.bat" : "vbnc";
+                       }
                }
 
                [MonoTODO]
@@ -346,4 +350,3 @@ namespace Microsoft.Build.Tasks {
        }
 }
 
-#endif