[xbuild] Remove unnecessary/inconsistent path conversion hack
authorMichael Hutchinson <m.j.hutchinson@gmail.com>
Tue, 28 Jan 2014 22:19:53 +0000 (17:19 -0500)
committerMichael Hutchinson <m.j.hutchinson@gmail.com>
Tue, 28 Jan 2014 23:24:38 +0000 (18:24 -0500)
Directory separators are automatically converted from Windows->Native
when parsing MSBuild files, but any paths provided in code must already
be native.

mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ManagedCompilerTest.cs
mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskItem.cs

index a9ba86125a880dfa04999835a3db3eadb450f6b5..91308f5855beb1414062a97fc59556faa56b8e5e 100644 (file)
@@ -26,6 +26,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 using System;
+using System.IO;
 using System.Collections;
 using Microsoft.Build.BuildEngine;
 using Microsoft.Build.Framework;
@@ -682,10 +683,11 @@ namespace MonoTests.Microsoft.Build.Tasks {
                        mc.References = null;
                        Assert.IsTrue (mc.CheckAllReferencesExistOnDisk (), "A2");
 
-                       mc.References = new ITaskItem [1] { new TaskItem (@"Test\resources\test.cs") };
+                       string path = Path.Combine (Path.Combine ("Test", "resources"), "test.cs");
+                       mc.References = new ITaskItem [1] { new TaskItem (path) };
                        Assert.IsTrue (mc.CheckAllReferencesExistOnDisk (), "A3");
 
-                       mc.References = new ITaskItem [2] { new TaskItem (@"Test\resources\test.cs"), new TaskItem ("X") };
+                       mc.References = new ITaskItem [2] { new TaskItem (path), new TaskItem ("X") };
                        Assert.IsFalse (mc.CheckAllReferencesExistOnDisk (), "A4");
                }
        }
index 03c018a54d97edb3fd9cf28451c22961127e636f..319c09976001abca841bea550e5d5e927c8355a2 100644 (file)
@@ -65,9 +65,6 @@ namespace Microsoft.Build.Utilities
                                throw new ArgumentNullException ("itemSpec");
                        
                        this.metadata = CollectionsUtil.CreateCaseInsensitiveHashtable ();
-
-                       // FIXME: hack
-                       this.itemSpec = itemSpec.Replace ('\\', Path.DirectorySeparatorChar);
                }
 
                public TaskItem (string itemSpec, IDictionary itemMetadata)