From 760706165543ce726b8f5de3de5ab3f16d132dd5 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Tue, 9 Dec 2014 10:26:22 +0100 Subject: [PATCH 1/2] Don't reference satellite assemblies - fixes #439 --- src/Paket.Core/InstallModel.fs | 2 +- .../InstallModel/Xml/System.Spatial.fs | 50 +++++++++++++++++++ tests/Paket.Tests/Paket.Tests.fsproj | 3 +- 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 tests/Paket.Tests/InstallModel/Xml/System.Spatial.fs diff --git a/src/Paket.Core/InstallModel.fs b/src/Paket.Core/InstallModel.fs index a61e56654a..65aed0ec87 100644 --- a/src/Paket.Core/InstallModel.fs +++ b/src/Paket.Core/InstallModel.fs @@ -179,7 +179,7 @@ type InstallModel = let blackList = [ fun (reference : Reference) -> match reference with - | Reference.Library lib -> not (lib.EndsWith ".dll" || lib.EndsWith ".exe") + | Reference.Library lib -> not (lib.EndsWith ".dll" || lib.EndsWith ".exe") || lib.EndsWith "resources.dll" | _ -> false ] blackList diff --git a/tests/Paket.Tests/InstallModel/Xml/System.Spatial.fs b/tests/Paket.Tests/InstallModel/Xml/System.Spatial.fs new file mode 100644 index 0000000000..0613d82d17 --- /dev/null +++ b/tests/Paket.Tests/InstallModel/Xml/System.Spatial.fs @@ -0,0 +1,50 @@ +module Paket.InstallModel.Xml.SystemSpatialSpecs + +open Paket +open NUnit.Framework +open FsUnit +open Paket.TestHelpers +open Paket.Domain + +let expected = """ + + + + + ..\..\..\System.Spatial\lib\sl4\System.Spatial.dll + True + True + + + + + + + ..\..\..\System.Spatial\lib\net40\System.Spatial.dll + True + True + + + +""" + +[] +let ``should generate Xml for System.Spatial``() = + let model = + InstallModel.CreateFromLibs(PackageName "System.Spatial", SemVer.Parse "5.6.3", None, + [ @"..\System.Spatial\lib\net40\System.Spatial.dll" + @"..\System.Spatial\lib\net40\de\System.Spatial.resources.dll" + @"..\System.Spatial\lib\net40\es\System.Spatial.resources.dll" + @"..\System.Spatial\lib\net40\zh-Hans\System.Spatial.resources.dll" + + @"..\System.Spatial\lib\sl4\System.Spatial.dll" + @"..\System.Spatial\lib\sl4\de\System.Spatial.resources.dll" + @"..\System.Spatial\lib\sl4\es\System.Spatial.resources.dll" + @"..\System.Spatial\lib\sl4\zh-Hans\System.Spatial.resources.dll" + ], + Nuspec.All) + + let chooseNode = ProjectFile.Load("./ProjectFile/TestData/Empty.fsprojtest").Value.GenerateXml(model) + chooseNode.OuterXml + |> normalizeXml + |> shouldEqual (normalizeXml expected) \ No newline at end of file diff --git a/tests/Paket.Tests/Paket.Tests.fsproj b/tests/Paket.Tests/Paket.Tests.fsproj index bbf9b65503..d7ae9a705a 100644 --- a/tests/Paket.Tests/Paket.Tests.fsproj +++ b/tests/Paket.Tests/Paket.Tests.fsproj @@ -1,4 +1,4 @@ - + @@ -193,6 +193,7 @@ + From 6efacb7b03d093197c6d709594fd852f505f1edc Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Tue, 9 Dec 2014 11:09:58 +0100 Subject: [PATCH 2/2] Give names to the filter expressions --- src/Paket.Core/InstallModel.fs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Paket.Core/InstallModel.fs b/src/Paket.Core/InstallModel.fs index 65aed0ec87..ef2a8fa775 100644 --- a/src/Paket.Core/InstallModel.fs +++ b/src/Paket.Core/InstallModel.fs @@ -176,11 +176,17 @@ type InstallModel = |> Seq.fold (fun model reference -> model.AddFrameworkAssemblyReference reference) this member this.FilterBlackList() = + let includeLibs = function + | Reference.Library lib -> not (lib.EndsWith ".dll" || lib.EndsWith ".exe") + | _ -> false + + let excludeSatelliteAssemblies = function + | Reference.Library lib -> lib.EndsWith "resources.dll" + | _ -> false + let blackList = - [ fun (reference : Reference) -> - match reference with - | Reference.Library lib -> not (lib.EndsWith ".dll" || lib.EndsWith ".exe") || lib.EndsWith "resources.dll" - | _ -> false ] + [ includeLibs + excludeSatelliteAssemblies] blackList |> List.map (fun f -> f >> not) // inverse