From 776c1c7713d3e29c4360fd17c7747351da0fb88b Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 8 Apr 2016 14:38:02 +0200 Subject: [PATCH] Property Definitions are placed after FSharp Targets - fixes #1585 --- RELEASE_NOTES.md | 3 + .../Paket.IntegrationTests/InstallSpecs.fs | 9 ++ .../before/paket.dependencies | 4 + .../before/xUnitTests.sln | 20 +++ .../before/xUnitTests/Class1.cs | 18 +++ .../xUnitTests/Properties/AssemblyInfo.cs | 15 ++ .../before/xUnitTests/paket.references | 1 + .../xUnitTests/xUnitTests.csprojtemplate | 130 ++++++++++++++++++ .../xUnitTests.expected.csprojtemplate | 130 ++++++++++++++++++ src/Paket.Core/ProjectFile.fs | 7 +- src/Paket/Paket.fsproj | 6 +- 11 files changed, 339 insertions(+), 4 deletions(-) create mode 100644 integrationtests/scenarios/i001585-websharper-props/before/paket.dependencies create mode 100644 integrationtests/scenarios/i001585-websharper-props/before/xUnitTests.sln create mode 100644 integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/Class1.cs create mode 100644 integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/Properties/AssemblyInfo.cs create mode 100644 integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/paket.references create mode 100644 integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/xUnitTests.csprojtemplate create mode 100644 integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/xUnitTests.expected.csprojtemplate diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 29c7e635a8..26303758f3 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 2.58.8 - 08.04.2016 +* Property Definitions are placed after FSharp Targets - https://github.com/fsprojects/Paket/issues/1585 + #### 2.58.7 - 07.04.2016 * Paket update supports combining filter with specific version - https://github.com/fsprojects/Paket/pull/1580 diff --git a/integrationtests/Paket.IntegrationTests/InstallSpecs.fs b/integrationtests/Paket.IntegrationTests/InstallSpecs.fs index f7cae91991..ea4fc7985d 100644 --- a/integrationtests/Paket.IntegrationTests/InstallSpecs.fs +++ b/integrationtests/Paket.IntegrationTests/InstallSpecs.fs @@ -66,6 +66,15 @@ let ``#1233 install props with framework restrictions``() = let s2 = File.ReadAllText newFile |> normalizeLineEndings s2 |> shouldEqual s1 +[] +let ``#1585 install props with for websharper``() = + let newLockFile = install "i001585-websharper-props" + let newFile = Path.Combine(scenarioTempPath "i001585-websharper-props","xUnitTests","xUnitTests.csproj") + let oldFile = Path.Combine(originalScenarioPath "i001585-websharper-props","xUnitTests","xUnitTests.expected.csprojtemplate") + let s1 = File.ReadAllText oldFile |> normalizeLineEndings + let s2 = File.ReadAllText newFile |> normalizeLineEndings + s2 |> shouldEqual s1 + [] let ``#1256 should report error in lock file``() = try diff --git a/integrationtests/scenarios/i001585-websharper-props/before/paket.dependencies b/integrationtests/scenarios/i001585-websharper-props/before/paket.dependencies new file mode 100644 index 0000000000..ff2191e540 --- /dev/null +++ b/integrationtests/scenarios/i001585-websharper-props/before/paket.dependencies @@ -0,0 +1,4 @@ +source https://www.nuget.org/api/v2 +framework: net45 + +nuget WebSharper 3.6.11.234 diff --git a/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests.sln b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests.sln new file mode 100644 index 0000000000..cba8f7b0a5 --- /dev/null +++ b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xUnitTests", "xUnitTests\xUnitTests.csproj", "{7E1F5308-F07D-44E7-B6B7-B9ED8FF278BF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7E1F5308-F07D-44E7-B6B7-B9ED8FF278BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E1F5308-F07D-44E7-B6B7-B9ED8FF278BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E1F5308-F07D-44E7-B6B7-B9ED8FF278BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E1F5308-F07D-44E7-B6B7-B9ED8FF278BF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/Class1.cs b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/Class1.cs new file mode 100644 index 0000000000..3d16c5a39d --- /dev/null +++ b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/Class1.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace xUnitTests +{ + public class When_testing + { + [Fact] + public void tests_work() + { + Assert.Equal(2, 1 + 1); + } + } +} diff --git a/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/Properties/AssemblyInfo.cs b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..8c8df12bc5 --- /dev/null +++ b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/Properties/AssemblyInfo.cs @@ -0,0 +1,15 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("xUnitTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("xUnitTests")] +[assembly: AssemblyCopyright("© 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] +[assembly: Guid("2d3480dd-4967-4b24-9740-c7a2d02942b9")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/paket.references b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/paket.references new file mode 100644 index 0000000000..a1429caedc --- /dev/null +++ b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/paket.references @@ -0,0 +1 @@ +WebSharper diff --git a/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/xUnitTests.csprojtemplate b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/xUnitTests.csprojtemplate new file mode 100644 index 0000000000..030ac382f1 --- /dev/null +++ b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/xUnitTests.csprojtemplate @@ -0,0 +1,130 @@ + + + + + Debug + AnyCPU + {7E1F5308-F07D-44E7-B6B7-B9ED8FF278BF} + Library + Properties + xUnitTests + xUnitTests + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + <__paket__WebSharper_targets>WebSharper + + + + + + + + + + + + + + + + + + + + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets + + + + + + + + + + ..\packages\WebSharper\lib\net40\WebSharper.Collections.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Control.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Core.JavaScript.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Core.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.InterfaceGenerator.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.JQuery.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.JavaScript.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Main.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Sitelets.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Web.dll + True + True + + + + + + \ No newline at end of file diff --git a/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/xUnitTests.expected.csprojtemplate b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/xUnitTests.expected.csprojtemplate new file mode 100644 index 0000000000..f436d4d5b6 --- /dev/null +++ b/integrationtests/scenarios/i001585-websharper-props/before/xUnitTests/xUnitTests.expected.csprojtemplate @@ -0,0 +1,130 @@ + + + + + Debug + AnyCPU + {7E1F5308-F07D-44E7-B6B7-B9ED8FF278BF} + Library + Properties + xUnitTests + xUnitTests + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets + + + + + + + + <__paket__WebSharper_targets>WebSharper + + + + + + + + + ..\packages\WebSharper\lib\net40\WebSharper.Collections.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Control.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Core.JavaScript.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Core.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.InterfaceGenerator.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.JQuery.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.JavaScript.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Main.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Sitelets.dll + True + True + + + ..\packages\WebSharper\lib\net40\WebSharper.Web.dll + True + True + + + + + + \ No newline at end of file diff --git a/src/Paket.Core/ProjectFile.fs b/src/Paket.Core/ProjectFile.fs index 1e109aa37d..cd3b007e76 100644 --- a/src/Paket.Core/ProjectFile.fs +++ b/src/Paket.Core/ProjectFile.fs @@ -956,7 +956,12 @@ module ProjectFile = let l = ref !k while !l < project.ProjectNode.ChildNodes.Count do - if String.containsIgnoreCase "microsoft.csharp.targets" (project.ProjectNode.ChildNodes.[!l].OuterXml.ToString()) then + let node = project.ProjectNode.ChildNodes.[!l].OuterXml.ToString() + if String.startsWithIgnoreCase " + @@ -29,8 +29,8 @@ Project paket.exe - update --hard - D:\code\Paket\integrationtests\scenarios\i001218-binding-redirect\temp + update + D:\code\Paket\integrationtests\scenarios\i001585-websharper-props\temp pdbonly