From 1f98a40a7611664b8c4dcbc5adfaf2fefe9d18cf Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Thu, 17 Mar 2016 10:22:59 +0100 Subject: [PATCH] Native settings are filered correctly - fixes #1523 --- RELEASE_NOTES.md | 3 + .../Paket.IntegrationTests/InstallSpecs.fs | 9 + .../i001523-mixed-native/before/TestPaket.sln | 28 +++ .../before/TestPaket/App.cpp | 8 + .../TestPaket/TestPaket.vcxproj.filters | 22 ++ .../TestPaket/TestPaket.vcxprojtemplate | 227 ++++++++++++++++++ .../before/TestPaket/paket.references | 2 + .../before/paket.dependencies | 5 + .../i001523-mixed-native/before/paket.lock | 9 + src/Paket.Core/FrameworkHandling.fs | 1 + src/Paket/Paket.fsproj | 4 +- tests/Paket.Tests/RestrictionFilterSpecs.fs | 10 + 12 files changed, 326 insertions(+), 2 deletions(-) create mode 100644 integrationtests/scenarios/i001523-mixed-native/before/TestPaket.sln create mode 100644 integrationtests/scenarios/i001523-mixed-native/before/TestPaket/App.cpp create mode 100644 integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxproj.filters create mode 100644 integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxprojtemplate create mode 100644 integrationtests/scenarios/i001523-mixed-native/before/TestPaket/paket.references create mode 100644 integrationtests/scenarios/i001523-mixed-native/before/paket.dependencies create mode 100644 integrationtests/scenarios/i001523-mixed-native/before/paket.lock diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index f305b332ea..c52f1710d3 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 2.52.10 - 17.03.2016 +* BUGFIX: Native settings are filered correctly - https://github.com/fsprojects/Paket/issues/1523 + #### 2.52.9 - 16.03.2016 * USABILITY: Improved error message when paket.dependencies can't be found - https://github.com/fsprojects/Paket/pull/1519 * BUGFIX: Force resolver to look into deeper levels - https://github.com/fsprojects/Paket/issues/1520 diff --git a/integrationtests/Paket.IntegrationTests/InstallSpecs.fs b/integrationtests/Paket.IntegrationTests/InstallSpecs.fs index 52d0acedeb..5c901a7243 100644 --- a/integrationtests/Paket.IntegrationTests/InstallSpecs.fs +++ b/integrationtests/Paket.IntegrationTests/InstallSpecs.fs @@ -256,6 +256,15 @@ let ``#1505 should install conditionals``() = let s1 = File.ReadAllText oldFile |> normalizeLineEndings let s2 = File.ReadAllText newFile |> normalizeLineEndings s2 |> shouldEqual s1 + +[] +let ``#1523 should install native in mixed setting``() = + install "i001523-mixed-native" |> ignore + let newFile = Path.Combine(scenarioTempPath "i001523-mixed-native","TestPaket","TestPaket.vcxproj") + let oldFile = Path.Combine(originalScenarioPath "i001523-mixed-native","TestPaket","TestPaket.vcxprojtemplate") + let s1 = File.ReadAllText oldFile |> normalizeLineEndings + let s2 = File.ReadAllText newFile |> normalizeLineEndings + s2 |> shouldEqual s1 [] let ``#1458 should not install conflicting deps from different groups``() = diff --git a/integrationtests/scenarios/i001523-mixed-native/before/TestPaket.sln b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket.sln new file mode 100644 index 0000000000..78094b7caf --- /dev/null +++ b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestPaket", "TestPaket\TestPaket.vcxproj", "{BDBD2D92-542F-4AC4-BCDB-5C6EFC42FD44}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BDBD2D92-542F-4AC4-BCDB-5C6EFC42FD44}.Debug|x64.ActiveCfg = Debug|x64 + {BDBD2D92-542F-4AC4-BCDB-5C6EFC42FD44}.Debug|x64.Build.0 = Debug|x64 + {BDBD2D92-542F-4AC4-BCDB-5C6EFC42FD44}.Debug|x86.ActiveCfg = Debug|Win32 + {BDBD2D92-542F-4AC4-BCDB-5C6EFC42FD44}.Debug|x86.Build.0 = Debug|Win32 + {BDBD2D92-542F-4AC4-BCDB-5C6EFC42FD44}.Release|x64.ActiveCfg = Release|x64 + {BDBD2D92-542F-4AC4-BCDB-5C6EFC42FD44}.Release|x64.Build.0 = Release|x64 + {BDBD2D92-542F-4AC4-BCDB-5C6EFC42FD44}.Release|x86.ActiveCfg = Release|Win32 + {BDBD2D92-542F-4AC4-BCDB-5C6EFC42FD44}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/App.cpp b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/App.cpp new file mode 100644 index 0000000000..6424ec9456 --- /dev/null +++ b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/App.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + std::cout << "hello world" << std::endl; + return 0; +} \ No newline at end of file diff --git a/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxproj.filters b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxproj.filters new file mode 100644 index 0000000000..942a5c6e41 --- /dev/null +++ b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxprojtemplate b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxprojtemplate new file mode 100644 index 0000000000..84d530c8e6 --- /dev/null +++ b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxprojtemplate @@ -0,0 +1,227 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {BDBD2D92-542F-4AC4-BCDB-5C6EFC42FD44} + Win32Proj + TestPaket + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + Disabled + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + + <__paket__boost_targets>native\boost + + + + + + + <__paket__boost_filesystem-vc140_targets>native\boost_filesystem-vc140 + + + + + + + + ..\packages\boost_filesystem-vc140\lib\native\address-model-32\lib\boost_filesystem-vc140-mt-1_60.dll + True + True + + + ..\packages\boost_filesystem-vc140\lib\native\address-model-32\lib\boost_filesystem-vc140-mt-gd-1_60.dll + True + True + + + ..\packages\boost_filesystem-vc140\lib\native\address-model-64\lib\boost_filesystem-vc140-mt-1_60.dll + True + True + + + ..\packages\boost_filesystem-vc140\lib\native\address-model-64\lib\boost_filesystem-vc140-mt-gd-1_60.dll + True + True + + + + + + + + <__paket__boost_system-vc140_targets>native\boost_system-vc140 + + + + + + + + ..\packages\boost_system-vc140\lib\native\address-model-32\lib\boost_system-vc140-mt-1_60.dll + True + True + + + ..\packages\boost_system-vc140\lib\native\address-model-32\lib\boost_system-vc140-mt-gd-1_60.dll + True + True + + + ..\packages\boost_system-vc140\lib\native\address-model-64\lib\boost_system-vc140-mt-1_60.dll + True + True + + + ..\packages\boost_system-vc140\lib\native\address-model-64\lib\boost_system-vc140-mt-gd-1_60.dll + True + True + + + + + + + + \ No newline at end of file diff --git a/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/paket.references b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/paket.references new file mode 100644 index 0000000000..f90501ff05 --- /dev/null +++ b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/paket.references @@ -0,0 +1,2 @@ +boost_filesystem-vc140 framework: native +boost_system-vc140 framework: native diff --git a/integrationtests/scenarios/i001523-mixed-native/before/paket.dependencies b/integrationtests/scenarios/i001523-mixed-native/before/paket.dependencies new file mode 100644 index 0000000000..38623e0ced --- /dev/null +++ b/integrationtests/scenarios/i001523-mixed-native/before/paket.dependencies @@ -0,0 +1,5 @@ +framework: net452, native + +source https://www.nuget.org/api/v2 +nuget boost_filesystem-vc140 +nuget boost_system-vc140 diff --git a/integrationtests/scenarios/i001523-mixed-native/before/paket.lock b/integrationtests/scenarios/i001523-mixed-native/before/paket.lock new file mode 100644 index 0000000000..1d38436141 --- /dev/null +++ b/integrationtests/scenarios/i001523-mixed-native/before/paket.lock @@ -0,0 +1,9 @@ +FRAMEWORK: NET452 +NUGET + remote: https://www.nuget.org/api/v2 + specs: + boost (1.60.0) + boost_filesystem-vc140 (1.60.0) + boost (1.60.0.0) + boost_system-vc140 (1.60.0) + boost (1.60.0.0) diff --git a/src/Paket.Core/FrameworkHandling.fs b/src/Paket.Core/FrameworkHandling.fs index c61c72d72a..0adf76f09c 100644 --- a/src/Paket.Core/FrameworkHandling.fs +++ b/src/Paket.Core/FrameworkHandling.fs @@ -163,6 +163,7 @@ type FrameworkIdentifier = | WindowsPhoneSilverlight _, WindowsPhoneSilverlight _ -> true | XamarinMac _, XamarinMac _ -> true | XamariniOS _, XamariniOS _ -> true + | Native _, Native _ -> true | _ -> false diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index 05aa1d6211..beb49b04c3 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -29,8 +29,8 @@ Project paket.exe - update - D:\code\Paket\integrationtests\scenarios\i001359-wrong-prerelease\temp + update --hard + D:\code\Paket\integrationtests\scenarios\i001523-mixed-native\temp pdbonly diff --git a/tests/Paket.Tests/RestrictionFilterSpecs.fs b/tests/Paket.Tests/RestrictionFilterSpecs.fs index 77c70905fe..5d5af7a44b 100644 --- a/tests/Paket.Tests/RestrictionFilterSpecs.fs +++ b/tests/Paket.Tests/RestrictionFilterSpecs.fs @@ -121,3 +121,13 @@ let ``should filter >= net20 < net40 and >= net40``() = filterRestrictions l1 l2 |> shouldEqual (FrameworkRestrictionList []) + +[] +let ``should not filter native, net452``() = + FrameworkRestriction.Exactly(Native("","")).IsSameCategoryAs(FrameworkRestriction.Exactly(Native("",""))) |> shouldEqual (Some true) + + let l1 = FrameworkRestrictionList [FrameworkRestriction.Exactly(DotNetFramework(FrameworkVersion.V4_5_2)); FrameworkRestriction.Exactly(Native("",""))] + let l2 = FrameworkRestrictionList [FrameworkRestriction.Exactly(Native("",""))] + + filterRestrictions l1 l2 + |> shouldEqual (FrameworkRestrictionList [FrameworkRestriction.Exactly(Native("",""))])