Skip to content

Commit 6a6619e

Browse files
committed
Revert "Don't create duplicate framework assembly references - fixes #297"
This reverts commit 035edbb.
1 parent a92689f commit 6a6619e

3 files changed

Lines changed: 13 additions & 26 deletions

File tree

‎RELEASE_NOTES.md‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#### 0.10.1 - 27.10.2014
2-
* Don't create duplicate framework assembly references - https://github.com/fsprojects/Paket/issues/297
3-
41
#### 0.10.0 - 24.10.2014
52
* Initial version of `paket remove` command - http://fsprojects.github.io/Paket/paket-remove.html
63
* Paket add doesn't fail on second attempt - https://github.com/fsprojects/Paket/issues/295

‎src/Paket.Core/ProjectFile.fs‎

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,6 @@ type ProjectFile =
142142

143143
!hasCustom
144144

145-
member this.HasFrameworkAssemblyNode(assemblyName) =
146-
let found = ref false
147-
for node in this.Document.SelectNodes("//ns:Reference", this.Namespaces) do
148-
if node.Attributes.["Include"].InnerText.Split(',').[0] = assemblyName then
149-
found := true
150-
151-
!found
152-
153145
member this.DeleteCustomNodes(model:InstallModel) =
154146
let nodesToDelete = List<_>()
155147

@@ -169,25 +161,22 @@ type ProjectFile =
169161
let itemGroup = createNode(this.Document,"ItemGroup")
170162

171163
for lib in references do
172-
match lib with
173-
| Reference.Library lib ->
174-
let fi = new FileInfo(normalizePath lib)
164+
let reference =
165+
match lib with
166+
| Reference.Library lib ->
167+
let fi = new FileInfo(normalizePath lib)
175168

176-
createNode(this.Document,"Reference")
177-
|> addAttribute "Include" (fi.Name.Replace(fi.Extension,""))
178-
|> addChild (createNodeWithText(this.Document,"HintPath",createRelativePath this.FileName fi.FullName))
179-
|> addChild (createNodeWithText(this.Document,"Private","True"))
180-
|> addChild (createNodeWithText(this.Document,"Paket","True"))
181-
|> itemGroup.AppendChild
182-
|> ignore
183-
| Reference.FrameworkAssemblyReference frameworkAssembly ->
184-
if not <| this.HasFrameworkAssemblyNode(frameworkAssembly) then
169+
createNode(this.Document,"Reference")
170+
|> addAttribute "Include" (fi.Name.Replace(fi.Extension,""))
171+
|> addChild (createNodeWithText(this.Document,"HintPath",createRelativePath this.FileName fi.FullName))
172+
|> addChild (createNodeWithText(this.Document,"Private","True"))
173+
|> addChild (createNodeWithText(this.Document,"Paket","True"))
174+
| Reference.FrameworkAssemblyReference frameworkAssembly ->
185175
createNode(this.Document,"Reference")
186176
|> addAttribute "Include" frameworkAssembly
187177
|> addChild (createNodeWithText(this.Document,"Paket","True"))
188-
|> itemGroup.AppendChild
189-
|> ignore
190-
178+
179+
itemGroup.AppendChild(reference) |> ignore
191180
itemGroup
192181

193182
let groupChooseNode = this.Document.CreateElement("Choose", Constants.ProjectDefaultNameSpace)

‎tests/Paket.Tests/InstallModel/Xml/ManualNodes.fs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
open Paket
44
open NUnit.Framework
55
open FsUnit
6+
open System.Xml
67

78
[<Test>]
89
let ``should find custom nodes in doc``() =

0 commit comments

Comments
 (0)