diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 69aa84fb50..1a3efd2ba3 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 2.52.16 - 17.03.2016 +* BUGFIX: Do not generate useless true conditions for Native - https://github.com/fsprojects/Paket/issues/1523 + #### 2.52.15 - 17.03.2016 * USABILITY: Automatically retry with force flag if we can't get package details for a given version - https://github.com/fsprojects/Paket/issues/1526 diff --git a/integrationtests/Paket.IntegrationTests/InstallSpecs.fs b/integrationtests/Paket.IntegrationTests/InstallSpecs.fs index 5c901a7243..24c46daf09 100644 --- a/integrationtests/Paket.IntegrationTests/InstallSpecs.fs +++ b/integrationtests/Paket.IntegrationTests/InstallSpecs.fs @@ -266,6 +266,21 @@ let ``#1523 should install native in mixed setting``() = let s2 = File.ReadAllText newFile |> normalizeLineEndings s2 |> shouldEqual s1 +[] +let ``#1523 should not emit true in mixed setting``() = + install "i001523-not-true" |> ignore + let newFile = Path.Combine(scenarioTempPath "i001523-not-true","TestPaket","TestPaket.vcxproj") + let oldFile = Path.Combine(originalScenarioPath "i001523-not-true","TestPaket","TestPaket.vcxprojtemplate") + let s1 = File.ReadAllText oldFile |> normalizeLineEndings + let s2 = File.ReadAllText newFile |> normalizeLineEndings + s2 |> shouldEqual s1 + + let newFile = Path.Combine(scenarioTempPath "i001523-not-true","TestPaketDotNet","TestPaketDotNet.csproj") + let oldFile = Path.Combine(originalScenarioPath "i001523-not-true","TestPaketDotNet","TestPaketDotNet.csprojtemplate") + 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``() = try diff --git a/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxprojtemplate b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxprojtemplate index 84d530c8e6..080afc5592 100644 --- a/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxprojtemplate +++ b/integrationtests/scenarios/i001523-mixed-native/before/TestPaket/TestPaket.vcxprojtemplate @@ -163,7 +163,7 @@ - + ..\packages\boost_filesystem-vc140\lib\native\address-model-32\lib\boost_filesystem-vc140-mt-1_60.dll @@ -196,7 +196,7 @@ - + ..\packages\boost_system-vc140\lib\native\address-model-32\lib\boost_system-vc140-mt-1_60.dll diff --git a/integrationtests/scenarios/i001523-not-true/before/TestPaket.sln b/integrationtests/scenarios/i001523-not-true/before/TestPaket.sln new file mode 100644 index 0000000000..fa6abe7de3 --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/before/TestPaket.sln @@ -0,0 +1,46 @@ + +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 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPaketDotNet", "TestPaketDotNet\TestPaketDotNet.csproj", "{AAE0F858-9A99-440B-983A-CD4EA5615AE5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BDBD2D92-542F-4AC4-BCDB-5C6EFC42FD44}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {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|Any CPU.ActiveCfg = Release|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 + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Debug|x64.ActiveCfg = Debug|Any CPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Debug|x64.Build.0 = Debug|Any CPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Debug|x86.ActiveCfg = Debug|Any CPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Debug|x86.Build.0 = Debug|Any CPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Release|Any CPU.Build.0 = Release|Any CPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Release|x64.ActiveCfg = Release|Any CPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Release|x64.Build.0 = Release|Any CPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Release|x86.ActiveCfg = Release|Any CPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/integrationtests/scenarios/i001523-not-true/before/TestPaket/App.cpp b/integrationtests/scenarios/i001523-not-true/before/TestPaket/App.cpp new file mode 100644 index 0000000000..6424ec9456 --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/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-not-true/before/TestPaket/TestPaket.vcxproj.filters b/integrationtests/scenarios/i001523-not-true/before/TestPaket/TestPaket.vcxproj.filters new file mode 100644 index 0000000000..942a5c6e41 --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/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-not-true/before/TestPaket/TestPaket.vcxprojtemplate b/integrationtests/scenarios/i001523-not-true/before/TestPaket/TestPaket.vcxprojtemplate new file mode 100644 index 0000000000..05e0f43fe5 --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/before/TestPaket/TestPaket.vcxprojtemplate @@ -0,0 +1,229 @@ + + + + + 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-not-true/before/TestPaket/paket.references b/integrationtests/scenarios/i001523-not-true/before/TestPaket/paket.references new file mode 100644 index 0000000000..f90501ff05 --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/before/TestPaket/paket.references @@ -0,0 +1,2 @@ +boost_filesystem-vc140 framework: native +boost_system-vc140 framework: native diff --git a/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/App.config b/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/App.config new file mode 100644 index 0000000000..88fa4027bd --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/Program.cs b/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/Program.cs new file mode 100644 index 0000000000..cbbb42cdc8 --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/Program.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TestPaketDotNet +{ + class Program + { + static void Main(string[] args) + { + } + } +} diff --git a/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/Properties/AssemblyInfo.cs b/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..da0462dea7 --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TestPaketDotNet")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TestPaketDotNet")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("aae0f858-9a99-440b-983a-cd4ea5615ae5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/TestPaketDotNet.csprojtemplate b/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/TestPaketDotNet.csprojtemplate new file mode 100644 index 0000000000..ee74ad370a --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/TestPaketDotNet.csprojtemplate @@ -0,0 +1,82 @@ + + + + + Debug + AnyCPU + {AAE0F858-9A99-440B-983A-CD4EA5615AE5} + Exe + Properties + TestPaketDotNet + TestPaketDotNet + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + ..\packages\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll + True + True + + + + + + + + + ..\packages\NUnit\lib\nunit.framework.dll + True + True + + + + + \ No newline at end of file diff --git a/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/paket.references b/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/paket.references new file mode 100644 index 0000000000..91a7da9873 --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/before/TestPaketDotNet/paket.references @@ -0,0 +1,2 @@ +Newtonsoft.Json +NUnit \ No newline at end of file diff --git a/integrationtests/scenarios/i001523-not-true/before/paket.dependencies b/integrationtests/scenarios/i001523-not-true/before/paket.dependencies new file mode 100644 index 0000000000..4ca98288d6 --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/before/paket.dependencies @@ -0,0 +1,7 @@ +framework: net452, native + +source https://www.nuget.org/api/v2 +nuget boost_filesystem-vc140 +nuget boost_system-vc140 +nuget Newtonsoft.Json +nuget NUnit 2.6.4 \ No newline at end of file diff --git a/integrationtests/scenarios/i001523-not-true/before/paket.lock b/integrationtests/scenarios/i001523-not-true/before/paket.lock new file mode 100644 index 0000000000..d6772ab8e7 --- /dev/null +++ b/integrationtests/scenarios/i001523-not-true/before/paket.lock @@ -0,0 +1,11 @@ +FRAMEWORK: NET452, NATIVE +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) + Newtonsoft.Json (8.0.3) + NUnit (2.6.4) diff --git a/src/Paket.Core/PlatformMatching.fs b/src/Paket.Core/PlatformMatching.fs index efdb32b22f..4b495d58f9 100644 --- a/src/Paket.Core/PlatformMatching.fs +++ b/src/Paket.Core/PlatformMatching.fs @@ -161,8 +161,12 @@ let getCondition (referenceCondition:string option) (targets : TargetProfile lis |> CheckIfFullyInGroup "WindowsPhoneApp" (fun x -> match x with | SinglePlatform(WindowsPhoneApp(_)) -> true | _ -> false) |> CheckIfFullyInGroup "WindowsPhone" (fun x -> match x with | SinglePlatform(WindowsPhoneSilverlight(_)) -> true | _ -> false) - let conditions = - targets + let conditions = + if targets = [SinglePlatform(Native("",""))] then + targets + else + targets + |> List.filter (fun x -> match x with | SinglePlatform(Native("","")) -> false | _ -> true ) |> List.map getTargetCondition |> List.filter (fun (_,v) -> v <> "false") |> List.append grouped diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index e8f4024f5f..9b770c2a76 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -30,7 +30,7 @@ Project paket.exe update - D:\code\Paket\integrationtests\scenarios\i001520-pinned-error\temp + D:\code\Paket\integrationtests\scenarios\i001523-not-true\temp pdbonly