Skip to content

Commit

Permalink
Framework dependencies were handled too strict - fixes #1206
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Nov 10, 2015
1 parent 97c820a commit c8789b5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.23.1 - 10.11.2015
* Framework dependencies were handled too strict - https://github.com/fsprojects/Paket/issues/1206

#### 2.23.0 - 09.11.2015
* Allow to exclude dependencies in template files - https://github.com/fsprojects/Paket/issues/1199
* Exposed TemplateFile types and Dependencies member - https://github.com/fsprojects/Paket/pull/1203
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@ let ``#1190 paket add nuget should handle transitive dependencies with restricti
let lockFile = LockFile.LoadFrom(Path.Combine(scenarioTempPath "i001190-transitive-deps","paket.lock"))
lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "xunit.abstractions"].Settings.FrameworkRestrictions
|> shouldEqual []



[<Test>]
let ``#1197 framework dependencies are not restricting each other``() =
let lockFile = update "i001197-too-strict-frameworks"

lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "log4net"].Version
|> shouldBeGreaterThan (SemVer.Parse "0")
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
framework: net40, net45, sl5
source https://nuget.org/api/v2

nuget log4net.ElasticSearch
12 changes: 7 additions & 5 deletions src/Paket.Core/PackageResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ module DependencySetFilter =
| _ -> false)
| _ -> true

let filterByRestrictions (restrictions:FrameworkRestriction seq) (dependencies:DependencySet) : DependencySet =
restrictions
|> Seq.fold (fun currentSet restriction ->
currentSet
|> Set.filter (isIncluded restriction)) dependencies
let filterByRestrictions (restrictions:FrameworkRestriction list) (dependencies:DependencySet) : DependencySet =
match restrictions with
| [] -> dependencies
| _ ->
dependencies
|> Set.filter (fun dependency ->
restrictions |> List.exists (fun r -> isIncluded r dependency))

/// Represents package details
type PackageDetails =
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
<StartArguments>update group Build</StartArguments>
<StartArguments>pack output D:\code\paketbug\output</StartArguments>
<StartArguments>install</StartArguments>
<StartArguments>restore</StartArguments>
<StartArguments>update</StartArguments>
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>c:\code\Paketkopie</StartWorkingDirectory>
<StartWorkingDirectory>C:\Temp\paket_test\</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\paketkopie</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\paketbug</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\paketrepro</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\fsBlog</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001197-too-strict-frameworks\temp\</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down

0 comments on commit c8789b5

Please sign in to comment.