Skip to content

Commit

Permalink
Merge pull request #1437 from pms1969/config-replacement
Browse files Browse the repository at this point in the history
fix convert-from-nuget
  • Loading branch information
forki committed Jan 28, 2016
2 parents 8fe6a08 + 40e3bef commit e06b8e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,11 @@ let ``#1225 should convert simple C# project with non-matching framework restric
requirement2.Name |> shouldEqual (PackageName "Newtonsoft.Json")
requirement2.VersionRequirement.ToString() |> shouldEqual "7.0.1"
requirement2.ResolverStrategy |> shouldEqual None
requirement2.Settings.FrameworkRestrictions |> shouldEqual [FrameworkRestriction.AtLeast(FrameworkIdentifier.DotNetFramework(FrameworkVersion.V4_Client))]
requirement2.Settings.FrameworkRestrictions |> shouldEqual [FrameworkRestriction.AtLeast(FrameworkIdentifier.DotNetFramework(FrameworkVersion.V4_Client))]

[<Test>]
let ``#1217 should replace packages.config files in project``() =
paket "convert-from-nuget" "i001217-convert-simple-project" |> ignore
let lockFile = LockFile.LoadFrom(Path.Combine(scenarioTempPath "i001217-convert-simple-project","paket.lock"))
let projectFile = ProjectFile.loadFromFile(Path.Combine(scenarioTempPath "i001217-convert-simple-project", "ClassLibrary1", "ClassLibrary1.csproj"))
projectFile.Document.OuterXml.Contains("packages.config") |> shouldEqual false
4 changes: 2 additions & 2 deletions src/Paket.Core/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ module ProjectFile =
let noneAndContentNodes =
(project.Document |> getDescendants "None") @
(project.Document |> getDescendants "Content")

match noneAndContentNodes |> List.tryFind (withAttributeValue "Include" Constants.PackagesConfigFile) with
| None -> ()
| Some nugetNode ->
Expand Down Expand Up @@ -1296,7 +1296,7 @@ type ProjectFile with

member this.GetAllInterProjectDependenciesWithProjectTemplates = ProjectFile.getAllReferencedProjects this |> ProjectFile.projectsWithTemplates this

member this.ReplaceNuGetPackagesFile () = ProjectFile.removeNuGetTargetsEntries this
member this.ReplaceNuGetPackagesFile () = ProjectFile.replaceNuGetPackagesFile this

member this.RemoveNuGetTargetsEntries () = ProjectFile.removeNuGetTargetsEntries this

Expand Down

0 comments on commit e06b8e3

Please sign in to comment.