提交 7e2a0db2 编写于 作者: E enricosada 提交者: latkin

fix invalid already rendered folder error

fixes #246
closes #391

commit 2c37b20d129a231a16d2e64cbf2f007aa73e40c4
Author: enricosada <enrico@sada.io>
Date:   Wed Apr 29 18:57:04 2015 +0200

    fix invalid already rendered folder error

    fix invalid already rendered folder error when a project contains
    folders with same name

commit b8d03011db57b3b5df66c31d3a1564352c947cd1
Author: enricosada <enrico@sada.io>
Date:   Wed May 6 23:30:12 2015 +0200

    add regression tests
上级 39f7f47d
......@@ -100,6 +100,17 @@ type RoundTrip() =
CompileItem @"A\qux.fs"]
this.``FsprojRoundtrip.PositiveTest``(MSBuildItems origItems, MSBuildItems expectedItems)
[<Test>]
member public this.``FsprojRoundTrip.Regression.FoldersWithSameName``() =
let items = MSBuildItems [CompileItem @"First\Second\bar.fs"
CompileItem @"Second\qux.fs"]
this.``FsprojRoundtrip.PositiveTest``(items, items)
[<Test>]
member public this.``FsprojRoundTrip.Regression.FoldersWithSameName2``() =
let items = MSBuildItems [CompileItem @"First\First\bar.fs"]
this.``FsprojRoundtrip.PositiveTest``(items, items)
member this.``Fsproj.NegativeTest``(items : MSBuildItems) =
DoWithTempFile "Test.fsproj" (fun file ->
File.AppendAllText(file, TheTests.SimpleFsprojText([], [], items.ToString()))
......
......@@ -120,7 +120,7 @@ type internal MSBuildUtilities() =
// push folder
Inc(curPathParts)
curPathParts.Add(pathParts.[curPathParts.Count]) // e.g. transition from A\ to A\D\E\bar.fs
if not(alreadyRenderedFolders.Add(curPathParts)) && throwIfCannotRender then
if not(alreadyRenderedFolders.Add(new List<string>(curPathParts))) && throwIfCannotRender then
raise <| new InvalidOperationException(String.Format(FSharpSR.GetString(FSharpSR.ProjectRenderFolderMultiple), projectNode.ProjectFile, bi.Include))
Inc(curPathParts)
if bi.ItemType = ProjectFileConstants.Folder then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册