Skip to content

Commit

Permalink
[xbuild] Remove unnecessary/inconsistent path conversion hack
Browse files Browse the repository at this point in the history
Directory separators are automatically converted from Windows->Native
when parsing MSBuild files, but any paths provided in code must already
be native.
  • Loading branch information
mhutch committed Jan 28, 2014
1 parent 216608a commit 9d344c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -682,10 +683,11 @@ public void TestCheckAllReferencesExistOnDisk1 ()
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");
}
}
Expand Down
Expand Up @@ -65,9 +65,6 @@ public TaskItem (string itemSpec)
throw new ArgumentNullException ("itemSpec");

this.metadata = CollectionsUtil.CreateCaseInsensitiveHashtable ();

// FIXME: hack
this.itemSpec = itemSpec.Replace ('\\', Path.DirectorySeparatorChar);
}

public TaskItem (string itemSpec, IDictionary itemMetadata)
Expand Down

0 comments on commit 9d344c3

Please sign in to comment.