diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 20a74b7990..6d5c56aff9 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 0.33.4 - 11.03.2015 +* BUGFIX: `paket install` respects manual paket nodes - https://github.com/fsprojects/Paket/issues/679 + #### 0.33.3 - 11.03.2015 * `paket pack` pretty-prints it's nuspec - https://github.com/fsprojects/Paket/issues/691 diff --git a/src/Paket.Core/ProjectFile.fs b/src/Paket.Core/ProjectFile.fs index 9fe1d7169a..f5ec6d6f1d 100644 --- a/src/Paket.Core/ProjectFile.fs +++ b/src/Paket.Core/ProjectFile.fs @@ -37,7 +37,8 @@ type ProjectFile = [for node in this.Document |> getDescendants name do let isPaketNode = ref false for child in node.ChildNodes do - if child.Name = "Paket" then isPaketNode := true + if child.Name = "Paket" && child.InnerText.ToLower() = "true" then + isPaketNode := true if !isPaketNode = paketOnes then yield node] @@ -187,10 +188,12 @@ type ProjectFile = let libs = model.GetLibReferencesLazy.Force() |> Set.map (fun lib -> lib.ReferenceName) - + this.GetCustomReferenceAndFrameworkNodes() - |> List.filter (fun node -> Set.contains (node.Attributes.["Include"].InnerText.Split(',').[0]) libs) - + |> List.filter (fun node -> + let libName = node.Attributes.["Include"].InnerText.Split(',').[0] + Set.contains libName libs) + member this.DeleteCustomModelNodes(model:InstallModel) = let nodesToDelete = this.GetCustomModelNodes(model) diff --git a/tests/Paket.Tests/InstallModel/Xml/ManualNodes.fs b/tests/Paket.Tests/InstallModel/Xml/ManualNodes.fs index abf92cd0fa..fa6f88357a 100644 --- a/tests/Paket.Tests/InstallModel/Xml/ManualNodes.fs +++ b/tests/Paket.Tests/InstallModel/Xml/ManualNodes.fs @@ -19,6 +19,19 @@ let ``should find custom nodes in doc``() = ProjectFile.Load("./ProjectFile/TestData/CustomFantomasNode.fsprojtest").Value.GetCustomModelNodes(model).IsEmpty |> shouldEqual false +[] +let ``should find custom Paket nodes in doc``() = + let model = + InstallModel.CreateFromLibs(PackageName "Fantomas", SemVer.Parse "1.5.0", [], + [ @"..\Fantomas\lib\FantomasLib.dll" + @"..\Fantomas\lib\FSharp.Core.dll" + @"..\Fantomas\lib\Fantomas.exe" ], + [], + Nuspec.Explicit ["FantomasLib.dll"]) + + ProjectFile.Load("./ProjectFile/TestData/CustomPaketFantomasNode.fsprojtest").Value.GetCustomModelNodes(model).IsEmpty + |> shouldEqual false + [] let ``should not find custom nodes if there are none``() = diff --git a/tests/Paket.Tests/Paket.Tests.fsproj b/tests/Paket.Tests/Paket.Tests.fsproj index c3ebc58ef0..b0ac5c676b 100644 --- a/tests/Paket.Tests/Paket.Tests.fsproj +++ b/tests/Paket.Tests/Paket.Tests.fsproj @@ -1,4 +1,4 @@ - + @@ -208,6 +208,9 @@ Always + + + Always Always diff --git a/tests/Paket.Tests/ProjectFile/TestData/CustomPaketFantomasNode.fsprojtest b/tests/Paket.Tests/ProjectFile/TestData/CustomPaketFantomasNode.fsprojtest new file mode 100644 index 0000000000..ea2c370b42 --- /dev/null +++ b/tests/Paket.Tests/ProjectFile/TestData/CustomPaketFantomasNode.fsprojtest @@ -0,0 +1,15 @@ + + + + + + ..\..\packages\Fanta\lib\Fanta.dll + True + + + ..\..\packages\Fantomas\lib\FantomasLib.dll + True + False + + + \ No newline at end of file