diff --git a/src/Paket.Core/InstallModel.fs b/src/Paket.Core/InstallModel.fs index a61e56654a..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") - | _ -> false ] + [ includeLibs + excludeSatelliteAssemblies] blackList |> List.map (fun f -> f >> not) // inverse 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 = """ +<Choose xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <When Condition="$(TargetFrameworkIdentifier) == 'Silverlight' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v5.0')"> + <ItemGroup> + <Reference Include="System.Spatial"> + <HintPath>..\..\..\System.Spatial\lib\sl4\System.Spatial.dll</HintPath> + <Private>True</Private> + <Paket>True</Paket> + </Reference> + </ItemGroup> + </When> + <When Condition="($(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3')) Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch')"> + <ItemGroup> + <Reference Include="System.Spatial"> + <HintPath>..\..\..\System.Spatial\lib\net40\System.Spatial.dll</HintPath> + <Private>True</Private> + <Paket>True</Paket> + </Reference> + </ItemGroup> + </When> +</Choose>""" + +[<Test>] +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 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> @@ -193,6 +193,7 @@ <Compile Include="InstallModel\ProcessingSpecs.fs" /> <Compile Include="InstallModel\Xml\Fantomas.fs" /> <Compile Include="InstallModel\Xml\Plossum.fs" /> + <Compile Include="InstallModel\Xml\System.Spatial.fs" /> <Compile Include="InstallModel\Xml\FantomasLib.fs" /> <Compile Include="InstallModel\Xml\Fuchu.fs" /> <Compile Include="InstallModel\Xml\SystemNetHttp.fs" />