Skip to content

Commit

Permalink
Don't report warnings for packages that are not installed for current…
Browse files Browse the repository at this point in the history
… target framework - fixes #1693
  • Loading branch information
forki committed Jun 23, 2016
1 parent b1da96a commit 7413053
Show file tree
Hide file tree
Showing 18 changed files with 29 additions and 174 deletions.
3 changes: 2 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#### 3.2.0-alpha001 - 23.06.2016
#### 3.2.0-alpha002 - 23.06.2016
* BUGFIX: Don't report warnings for packages that are not installed for current target framework - https://github.com/fsprojects/Paket/issues/1693
* BUGFIX: Runtime deps are copied based on TargetFramework - https://github.com/fsprojects/Paket/issues/1751
* BUGFIX: Do not take over control over manual nodes - https://github.com/fsprojects/Paket/issues/1746
* BUGFIX: Better error message when log file is missing - https://github.com/fsprojects/Paket/issues/1743
Expand Down
6 changes: 0 additions & 6 deletions integrationtests/Paket.IntegrationTests/InstallSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,6 @@ let ``#1458 should not install conflicting deps from different groups``() =
with
| exn when exn.Message.Contains "Package Nancy is referenced in different versions" -> ()


[<Test>]
let ``#1442 warn if install finds no libs``() =
let result = paket "install" "i001442-warn-if-empty"
result |> shouldContainText "contains libraries, but not for the selected TargetFramework"

[<Test>]
let ``#1442 should not warn on SonarLint``() =
let result = paket "install" "i001442-dont-warn"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file removed nupkgs/NUnit.3.2.0.nupkg
Binary file not shown.
Binary file added nupkgs/NUnit.3.3.0-CI-2857-issue-1593.nupkg
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Paket.Bootstrapper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
[assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")]
[assembly: AssemblyVersionAttribute("3.2.0")]
[assembly: AssemblyFileVersionAttribute("3.2.0")]
[assembly: AssemblyInformationalVersionAttribute("3.2.0-alpha001")]
[assembly: AssemblyInformationalVersionAttribute("3.2.0-alpha002")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "3.2.0";
internal const string InformationalVersion = "3.2.0-alpha001";
internal const string InformationalVersion = "3.2.0-alpha002";
}
}
4 changes: 2 additions & 2 deletions src/Paket.Core/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ open System.Reflection
[<assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")>]
[<assembly: AssemblyVersionAttribute("3.2.0")>]
[<assembly: AssemblyFileVersionAttribute("3.2.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.2.0-alpha001")>]
[<assembly: AssemblyInformationalVersionAttribute("3.2.0-alpha002")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "3.2.0"
let [<Literal>] InformationalVersion = "3.2.0-alpha001"
let [<Literal>] InformationalVersion = "3.2.0-alpha002"
22 changes: 12 additions & 10 deletions src/Paket.Core/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -882,23 +882,25 @@ module ProjectFile =
|> Seq.map (fun kv ->
deleteCustomModelNodes (snd kv.Value) project
let installSettings = snd usedPackages.[kv.Key]
let restrictionList = installSettings.FrameworkRestrictions |> getRestrictionList
let projectModel =
(snd kv.Value)
.ApplyFrameworkRestrictions(installSettings.FrameworkRestrictions |> getRestrictionList)
.ApplyFrameworkRestrictions(restrictionList)
.FilterExcludes(installSettings.Excludes)
.RemoveIfCompletelyEmpty()

match getTargetFramework project with
| Some targetFramework ->
if projectModel.GetLibReferences targetFramework |> Seq.isEmpty then
let libReferences =
projectModel.GetLibReferencesLazy |> force
|> Seq.filter (fun l -> match l with | Reference.Library _ -> true | _ -> false)

if not (Seq.isEmpty libReferences) then
traceWarnfn "Package %O contains libraries, but not for the selected TargetFramework %O in project %s."
(snd kv.Key) targetFramework project.FileName
| None -> ()
if isTargetMatchingRestrictions(restrictionList,SinglePlatform targetFramework) then
if projectModel.GetLibReferences targetFramework |> Seq.isEmpty then
let libReferences =
projectModel.GetLibReferencesLazy |> force
|> Seq.filter (fun l -> match l with | Reference.Library _ -> true | _ -> false)

if not (Seq.isEmpty libReferences) then
traceWarnfn "Package %O contains libraries, but not for the selected TargetFramework %O in project %s."
(snd kv.Key) targetFramework project.FileName
| _ -> ()

let copyLocal = defaultArg installSettings.CopyLocal true
let importTargets = defaultArg installSettings.ImportTargets true
Expand Down
1 change: 1 addition & 0 deletions src/Paket.Core/Requirements.fs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ let filterRestrictions (list1:FrameworkRestrictions) (list2:FrameworkRestriction
/// Get if a target should be considered with the specified restrictions
let isTargetMatchingRestrictions =
memoize <| fun (restrictions:FrameworkRestriction list, target) ->
if List.isEmpty restrictions then true else
match target with
| SinglePlatform (Runtimes _ ) -> true
| SinglePlatform pf ->
Expand Down
4 changes: 2 additions & 2 deletions src/Paket.PowerShell/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ open System.Reflection
[<assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")>]
[<assembly: AssemblyVersionAttribute("3.2.0")>]
[<assembly: AssemblyFileVersionAttribute("3.2.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.2.0-alpha001")>]
[<assembly: AssemblyInformationalVersionAttribute("3.2.0-alpha002")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "3.2.0"
let [<Literal>] InformationalVersion = "3.2.0-alpha001"
let [<Literal>] InformationalVersion = "3.2.0-alpha002"
4 changes: 2 additions & 2 deletions src/Paket/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ open System.Reflection
[<assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")>]
[<assembly: AssemblyVersionAttribute("3.2.0")>]
[<assembly: AssemblyFileVersionAttribute("3.2.0")>]
[<assembly: AssemblyInformationalVersionAttribute("3.2.0-alpha001")>]
[<assembly: AssemblyInformationalVersionAttribute("3.2.0-alpha002")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "3.2.0"
let [<Literal>] InformationalVersion = "3.2.0-alpha001"
let [<Literal>] InformationalVersion = "3.2.0-alpha002"
2 changes: 1 addition & 1 deletion src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<StartArguments>update -f</StartArguments>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001117-aws\temp</StartWorkingDirectory>
<StartArguments>update</StartArguments>
<StartWorkingDirectory>D:\code\paket3dotnetcoreissue</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001442-warn-Rx\temp</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
Expand Down
9 changes: 5 additions & 4 deletions src/Paket/PlatformTask.fs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ type CopyRuntimeDependencies() =
try
let g = lockFile.Groups.[groupName]
let p = g.Resolution.[packageName]
match filterRestrictions g.Options.Settings.FrameworkRestrictions p.Settings.FrameworkRestrictions with
| FrameworkRestrictionList restrictions ->
isTargetMatchingRestrictions(restrictions,restriction)
| _ -> true
let restrictions =
filterRestrictions g.Options.Settings.FrameworkRestrictions p.Settings.FrameworkRestrictions
|> getRestrictionList

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

0 comments on commit 7413053

Please sign in to comment.