Skip to content

Commit

Permalink
Make the copy task more robust if we can't parse target framework - r…
Browse files Browse the repository at this point in the history
…eferences #1756
  • Loading branch information
forki committed Jun 25, 2016
1 parent 23b5485 commit 2ed3f8c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 3.3.1 - 25.06.2016
* BUGFIX: Make the copy task more robust if we can't parse target framework - https://github.com/fsprojects/Paket/issues/1756

#### 3.3.0 - 25.06.2016
* Paket fails on dependencies file that has same package twice in same group - https://github.com/fsprojects/Paket/issues/1757
* Paket.SemVer.Parse is now in PublicAPI.fs - https://github.com/fsprojects/Paket/pull/1754
Expand Down
2 changes: 1 addition & 1 deletion src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<StartWorkingDirectory>D:\code\PaketKopie</StartWorkingDirectory>
<StartArguments>update -f</StartArguments>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001117-aws\temp</StartWorkingDirectory>
<StartArguments>restore</StartArguments>
<StartArguments>convert-from-nuget</StartArguments>
<StartWorkingDirectory>D:\temp\paket</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup>
Expand Down
37 changes: 20 additions & 17 deletions src/Paket/PlatformTask.fs
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,27 @@ type CopyRuntimeDependencies() =

let packagesToInstall =
if not <| String.IsNullOrEmpty targetFramework then
let s = targetFramework.Split([|" - "|],StringSplitOptions.None)
let restriction =
match FrameworkDetection.Extract(s.[0] + s.[1].Replace("v","")) with
| None -> SinglePlatform(DotNetFramework FrameworkVersion.V4)
| Some x -> SinglePlatform(x)

packagesToInstall
|> Array.filter (fun (groupName,packageName) ->
try
let g = lockFile.Groups.[groupName]
let p = g.Resolution.[packageName]
let restrictions =
filterRestrictions g.Options.Settings.FrameworkRestrictions p.Settings.FrameworkRestrictions
|> getRestrictionList
try
let s = targetFramework.Split([|" - "|],StringSplitOptions.None)
let restriction =
match FrameworkDetection.Extract(s.[0] + s.[1].Replace("v","")) with
| None -> SinglePlatform(DotNetFramework FrameworkVersion.V4)
| Some x -> SinglePlatform(x)

packagesToInstall
|> Array.filter (fun (groupName,packageName) ->
try
let g = lockFile.Groups.[groupName]
let p = g.Resolution.[packageName]
let restrictions =
filterRestrictions g.Options.Settings.FrameworkRestrictions p.Settings.FrameworkRestrictions
|> getRestrictionList

isTargetMatchingRestrictions(restrictions,restriction)
with
| _ -> true)
isTargetMatchingRestrictions(restrictions,restriction)
with
| _ -> true)
with
| _ -> packagesToInstall
else
packagesToInstall

Expand Down

0 comments on commit 2ed3f8c

Please sign in to comment.