From f06920028c66251b726010dccd442adbec6b7162 Mon Sep 17 00:00:00 2001 From: Sergey Tregub Date: Fri, 31 Mar 2017 17:04:25 +0300 Subject: [PATCH 01/45] Fix #2213 - Workaround for TFS dependency resolution --- src/Paket.Core/NuGetV2.fs | 8 ++++++-- src/Paket.Core/NuGetV3.fs | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Paket.Core/NuGetV2.fs b/src/Paket.Core/NuGetV2.fs index 8537442433..477613dd4c 100644 --- a/src/Paket.Core/NuGetV2.fs +++ b/src/Paket.Core/NuGetV2.fs @@ -265,6 +265,9 @@ let getDetailsFromNuGetViaODataFast auth nugetURL (packageName:PackageName) (ver return parseODataDetails(url,nugetURL,packageName,version,raw) } +let urlSimilarToTfsOrVsts url = + String.containsIgnoreCase "visualstudio.com" url || (String.containsIgnoreCase "/_packaging/" url && String.containsIgnoreCase "/nuget/v" url) + /// Gets package details from NuGet via OData let getDetailsFromNuGetViaOData auth nugetURL (packageName:PackageName) (version:SemVerInfo) = let queryPackagesProtocol (packageName:PackageName) = @@ -293,8 +296,9 @@ let getDetailsFromNuGetViaOData auth nugetURL (packageName:PackageName) (version async { try let! result = getDetailsFromNuGetViaODataFast auth nugetURL packageName version - if String.containsIgnoreCase "visualstudio.com" nugetURL && result.Dependencies.IsEmpty then + if urlSimilarToTfsOrVsts nugetURL && result.Dependencies.IsEmpty then // TODO: There is a bug in VSTS, so we can't trust this protocol. Remvoe when VSTS is fixed + // TODO: TFS has the same bug return! queryPackagesProtocol packageName else return result @@ -679,7 +683,7 @@ let rec private getPackageDetails alternativeProjectRoot root force (sources:Pac match source with | NuGetV2 nugetSource -> return! tryV2 source nugetSource - | NuGetV3 nugetSource when nugetSource.Url.Contains("pkgs.visualstudio.com") -> + | NuGetV3 nugetSource when urlSimilarToTfsOrVsts nugetSource.Url -> match NuGetV3.calculateNuGet2Path nugetSource.Url with | Some url -> let nugetSource : NugetSource = diff --git a/src/Paket.Core/NuGetV3.fs b/src/Paket.Core/NuGetV3.fs index b95deaab70..1db804321e 100644 --- a/src/Paket.Core/NuGetV3.fs +++ b/src/Paket.Core/NuGetV3.fs @@ -41,6 +41,7 @@ let calculateNuGet3Path(nugetUrl:string) = | "http://www.nuget.org/api/v2" -> Some "http://api.nuget.org/v3/index.json" | "https://www.nuget.org/api/v2" -> Some "https://api.nuget.org/v3/index.json" | url when url.EndsWith("/nuget/v2") && url.Contains("pkgs.visualstudio.com") -> Some (url.Replace("/nuget/v2","/nuget/v3/index.json")) + | url when url.EndsWith("/nuget/v2") && url.Contains("/_packaging/") -> Some (url.Replace("/nuget/v2","/nuget/v3/index.json")) // TFS | url when url.EndsWith("api/v2") && url.Contains("visualstudio.com") -> Some (url.Replace("api/v2","api/v3/index.json")) | url when url.EndsWith("api/v2") && url.Contains("myget.org") -> Some (url.Replace("api/v2","api/v3/index.json")) | url when url.EndsWith("v3/index.json") -> Some url From fe854b9cd5e632ce27b31a05f904acc598d0af02 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 31 Mar 2017 16:19:02 +0200 Subject: [PATCH 02/45] RELEASE_NOTES --- RELEASE_NOTES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 1dddb107a4..e81086df24 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 4.1.4 - 31.03.2017 +* BUGFIX: Workaround for TFS dependency resolution - https://github.com/fsprojects/Paket/pull/2214 + #### 4.1.3 - 30.03.2017 * Support for dotnet pack * BUGFIX: Handle empty references files for .NET Core From e240de6419d7a033b4edbe01202187f094247953 Mon Sep 17 00:00:00 2001 From: Jeremy Blosser Date: Fri, 31 Mar 2017 14:52:43 -0500 Subject: [PATCH 03/45] Fix to handle weird malformed portable-only libraries. The nuget parser handles folders in the form of: {Identifier}{Version}-{Profile} So the string: `portable-net45+win8+wp8` gets parsed to: `.NETPortable,Version=v0.0,Profile=net45+win8+wp8` The string: `portable45-net45+win8+wp8` gets parsed to: `.NETPortable,Version=v4.5,Profile=net45+win8+wp8` Both end up being "valid", but for portable frameworks, the version doesn't matter (the profile does). The fix is to use a regex to strip out "portable-" and "portable{version}-" when doing platform matching. --- src/Paket.Core/PlatformMatching.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Paket.Core/PlatformMatching.fs b/src/Paket.Core/PlatformMatching.fs index cfca3afcc2..829e909fc7 100644 --- a/src/Paket.Core/PlatformMatching.fs +++ b/src/Paket.Core/PlatformMatching.fs @@ -7,7 +7,7 @@ let MaxPenalty = 1000000 let inline split (path : string) = path.Split('+') - |> Array.map (fun s -> s.Replace("portable-", "")) + |> Array.map (fun s -> System.Text.RegularExpressions.Regex.Replace(s, "portable\\d*-","")) let extractPlatforms = memoize (fun path -> split path |> Array.choose FrameworkDetection.Extract |> Array.toList) From c24de7b79d66304ec58d7cf48c63b43ef8957dab Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 2 Apr 2017 18:41:12 +0200 Subject: [PATCH 04/45] Detect changes in redirects settings --- RELEASE_NOTES.md | 3 +++ src/Paket.Bootstrapper/Properties/AssemblyInfo.cs | 12 ++++++------ src/Paket.Core/AssemblyInfo.fs | 12 ++++++------ src/Paket.Core/BindingRedirects.fs | 6 +++--- src/Paket.Core/Requirements.fs | 1 + src/Paket.PowerShell/AssemblyInfo.fs | 12 ++++++------ src/Paket/AssemblyInfo.fs | 12 ++++++------ src/Paket/Paket.fsproj | 4 ++-- 8 files changed, 33 insertions(+), 29 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e81086df24..a5274c88f9 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 4.1.5 - 02.04.2017 +* BUGFIX: Detect changes in redirects settings + #### 4.1.4 - 31.03.2017 * BUGFIX: Workaround for TFS dependency resolution - https://github.com/fsprojects/Paket/pull/2214 diff --git a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs index c02d665db9..37ea964188 100644 --- a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs +++ b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs @@ -4,16 +4,16 @@ [assembly: AssemblyTitleAttribute("Paket.Bootstrapper")] [assembly: AssemblyProductAttribute("Paket")] [assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")] -[assembly: AssemblyVersionAttribute("4.1.3")] -[assembly: AssemblyFileVersionAttribute("4.1.3")] -[assembly: AssemblyInformationalVersionAttribute("4.1.3")] +[assembly: AssemblyVersionAttribute("4.1.4")] +[assembly: AssemblyFileVersionAttribute("4.1.4")] +[assembly: AssemblyInformationalVersionAttribute("4.1.4")] namespace System { internal static class AssemblyVersionInformation { internal const System.String AssemblyTitle = "Paket.Bootstrapper"; internal const System.String AssemblyProduct = "Paket"; internal const System.String AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories."; - internal const System.String AssemblyVersion = "4.1.3"; - internal const System.String AssemblyFileVersion = "4.1.3"; - internal const System.String AssemblyInformationalVersion = "4.1.3"; + internal const System.String AssemblyVersion = "4.1.4"; + internal const System.String AssemblyFileVersion = "4.1.4"; + internal const System.String AssemblyInformationalVersion = "4.1.4"; } } diff --git a/src/Paket.Core/AssemblyInfo.fs b/src/Paket.Core/AssemblyInfo.fs index 80eabaa85d..05283b0263 100644 --- a/src/Paket.Core/AssemblyInfo.fs +++ b/src/Paket.Core/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.3" - let [] AssemblyFileVersion = "4.1.3" - let [] AssemblyInformationalVersion = "4.1.3" + let [] AssemblyVersion = "4.1.4" + let [] AssemblyFileVersion = "4.1.4" + let [] AssemblyInformationalVersion = "4.1.4" diff --git a/src/Paket.Core/BindingRedirects.fs b/src/Paket.Core/BindingRedirects.fs index 0a821bd302..5625a7d2f0 100644 --- a/src/Paket.Core/BindingRedirects.fs +++ b/src/Paket.Core/BindingRedirects.fs @@ -170,19 +170,19 @@ let private applyBindingRedirects isFirstGroup cleanBindingRedirects (allKnownLi /// Applies a set of binding redirects to all .config files in a specific folder. let applyBindingRedirectsToFolder isFirstGroup createNewBindingFiles cleanBindingRedirects rootPath allKnownLibs bindingRedirects = let applyBindingRedirects projectFile = - let bindingRedirects = bindingRedirects projectFile + let bindingRedirects = bindingRedirects projectFile |> Seq.toList let path = Path.GetDirectoryName projectFile.FileName match getConfig Directory.GetFiles path with | Some c -> Some c | None -> - match createNewBindingFiles, Seq.isEmpty bindingRedirects with + match createNewBindingFiles, List.isEmpty bindingRedirects with | true, false -> let config = createAppConfigInDirectory path addConfigFileToProject projectFile Some config | _ -> None |> Option.iter (applyBindingRedirects isFirstGroup cleanBindingRedirects allKnownLibs bindingRedirects) - + rootPath |> getProjectFilesWithPaketReferences Directory.GetFiles |> Seq.map ProjectFile.TryLoad diff --git a/src/Paket.Core/Requirements.fs b/src/Paket.Core/Requirements.fs index ffc3b733f5..c12f2f88da 100644 --- a/src/Paket.Core/Requirements.fs +++ b/src/Paket.Core/Requirements.fs @@ -620,6 +620,7 @@ type InstallSettings = CopyContentToOutputDirectory = self.CopyContentToOutputDirectory ++ other.CopyContentToOutputDirectory ReferenceCondition = self.ReferenceCondition ++ other.ReferenceCondition Excludes = self.Excludes @ other.Excludes + CreateBindingRedirects = self.CreateBindingRedirects ++ other.CreateBindingRedirects IncludeVersionInPath = self.IncludeVersionInPath ++ other.IncludeVersionInPath } diff --git a/src/Paket.PowerShell/AssemblyInfo.fs b/src/Paket.PowerShell/AssemblyInfo.fs index ac933b6aa4..e23820fdf1 100644 --- a/src/Paket.PowerShell/AssemblyInfo.fs +++ b/src/Paket.PowerShell/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.3" - let [] AssemblyFileVersion = "4.1.3" - let [] AssemblyInformationalVersion = "4.1.3" + let [] AssemblyVersion = "4.1.4" + let [] AssemblyFileVersion = "4.1.4" + let [] AssemblyInformationalVersion = "4.1.4" diff --git a/src/Paket/AssemblyInfo.fs b/src/Paket/AssemblyInfo.fs index 5452c2fa8f..f65ba56504 100644 --- a/src/Paket/AssemblyInfo.fs +++ b/src/Paket/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.3" - let [] AssemblyFileVersion = "4.1.3" - let [] AssemblyInformationalVersion = "4.1.3" + let [] AssemblyVersion = "4.1.4" + let [] AssemblyFileVersion = "4.1.4" + let [] AssemblyInformationalVersion = "4.1.4" diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index 09207094d5..810a954873 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -37,8 +37,8 @@ D:\temp\coreclrtest install C:\dev\src\Paket\integrationtests\scenarios\loading-scripts\dependencies-file-flag\temp - restore - D:\temp\watchr2 + install --createnewbindingfiles + D:\temp\pakkit2 pdbonly From cfb1f55d094ec863da33ecfd4fc7e867ebffa9b1 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 2 Apr 2017 18:45:33 +0200 Subject: [PATCH 05/45] Bump version to 4.1.5 --- src/Paket.Bootstrapper/Properties/AssemblyInfo.cs | 12 ++++++------ src/Paket.Core/AssemblyInfo.fs | 12 ++++++------ src/Paket.PowerShell/AssemblyInfo.fs | 12 ++++++------ src/Paket/AssemblyInfo.fs | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs index 37ea964188..affcbed9d4 100644 --- a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs +++ b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs @@ -4,16 +4,16 @@ [assembly: AssemblyTitleAttribute("Paket.Bootstrapper")] [assembly: AssemblyProductAttribute("Paket")] [assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")] -[assembly: AssemblyVersionAttribute("4.1.4")] -[assembly: AssemblyFileVersionAttribute("4.1.4")] -[assembly: AssemblyInformationalVersionAttribute("4.1.4")] +[assembly: AssemblyVersionAttribute("4.1.5")] +[assembly: AssemblyFileVersionAttribute("4.1.5")] +[assembly: AssemblyInformationalVersionAttribute("4.1.5")] namespace System { internal static class AssemblyVersionInformation { internal const System.String AssemblyTitle = "Paket.Bootstrapper"; internal const System.String AssemblyProduct = "Paket"; internal const System.String AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories."; - internal const System.String AssemblyVersion = "4.1.4"; - internal const System.String AssemblyFileVersion = "4.1.4"; - internal const System.String AssemblyInformationalVersion = "4.1.4"; + internal const System.String AssemblyVersion = "4.1.5"; + internal const System.String AssemblyFileVersion = "4.1.5"; + internal const System.String AssemblyInformationalVersion = "4.1.5"; } } diff --git a/src/Paket.Core/AssemblyInfo.fs b/src/Paket.Core/AssemblyInfo.fs index 05283b0263..73ecd9aa82 100644 --- a/src/Paket.Core/AssemblyInfo.fs +++ b/src/Paket.Core/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.4" - let [] AssemblyFileVersion = "4.1.4" - let [] AssemblyInformationalVersion = "4.1.4" + let [] AssemblyVersion = "4.1.5" + let [] AssemblyFileVersion = "4.1.5" + let [] AssemblyInformationalVersion = "4.1.5" diff --git a/src/Paket.PowerShell/AssemblyInfo.fs b/src/Paket.PowerShell/AssemblyInfo.fs index e23820fdf1..23a8c6072c 100644 --- a/src/Paket.PowerShell/AssemblyInfo.fs +++ b/src/Paket.PowerShell/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.4" - let [] AssemblyFileVersion = "4.1.4" - let [] AssemblyInformationalVersion = "4.1.4" + let [] AssemblyVersion = "4.1.5" + let [] AssemblyFileVersion = "4.1.5" + let [] AssemblyInformationalVersion = "4.1.5" diff --git a/src/Paket/AssemblyInfo.fs b/src/Paket/AssemblyInfo.fs index f65ba56504..b9983d0cee 100644 --- a/src/Paket/AssemblyInfo.fs +++ b/src/Paket/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.4" - let [] AssemblyFileVersion = "4.1.4" - let [] AssemblyInformationalVersion = "4.1.4" + let [] AssemblyVersion = "4.1.5" + let [] AssemblyFileVersion = "4.1.5" + let [] AssemblyInformationalVersion = "4.1.5" From 6e525b851c3e9b23223f9ca5acd255f8dca89bdf Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Mon, 3 Apr 2017 19:25:16 +0200 Subject: [PATCH 06/45] RELEASE_NOTES --- RELEASE_NOTES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index a5274c88f9..847df0ab66 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 4.1.6 - 02.04.2017 +* BUGFIX: Fix to handle weird malformed portable-only libraries - https://github.com/fsprojects/Paket/pull/2215 + #### 4.1.5 - 02.04.2017 * BUGFIX: Detect changes in redirects settings From 433c6dd125bcdc0bc7e7699df2fe3579cdf73495 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Mon, 3 Apr 2017 19:29:35 +0200 Subject: [PATCH 07/45] Bump version to 4.1.6 --- src/Paket.Bootstrapper/Properties/AssemblyInfo.cs | 12 ++++++------ src/Paket.Core/AssemblyInfo.fs | 12 ++++++------ src/Paket.PowerShell/AssemblyInfo.fs | 12 ++++++------ src/Paket/AssemblyInfo.fs | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs index affcbed9d4..02fd53406f 100644 --- a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs +++ b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs @@ -4,16 +4,16 @@ [assembly: AssemblyTitleAttribute("Paket.Bootstrapper")] [assembly: AssemblyProductAttribute("Paket")] [assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")] -[assembly: AssemblyVersionAttribute("4.1.5")] -[assembly: AssemblyFileVersionAttribute("4.1.5")] -[assembly: AssemblyInformationalVersionAttribute("4.1.5")] +[assembly: AssemblyVersionAttribute("4.1.6")] +[assembly: AssemblyFileVersionAttribute("4.1.6")] +[assembly: AssemblyInformationalVersionAttribute("4.1.6")] namespace System { internal static class AssemblyVersionInformation { internal const System.String AssemblyTitle = "Paket.Bootstrapper"; internal const System.String AssemblyProduct = "Paket"; internal const System.String AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories."; - internal const System.String AssemblyVersion = "4.1.5"; - internal const System.String AssemblyFileVersion = "4.1.5"; - internal const System.String AssemblyInformationalVersion = "4.1.5"; + internal const System.String AssemblyVersion = "4.1.6"; + internal const System.String AssemblyFileVersion = "4.1.6"; + internal const System.String AssemblyInformationalVersion = "4.1.6"; } } diff --git a/src/Paket.Core/AssemblyInfo.fs b/src/Paket.Core/AssemblyInfo.fs index 73ecd9aa82..3d76fc135e 100644 --- a/src/Paket.Core/AssemblyInfo.fs +++ b/src/Paket.Core/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.5" - let [] AssemblyFileVersion = "4.1.5" - let [] AssemblyInformationalVersion = "4.1.5" + let [] AssemblyVersion = "4.1.6" + let [] AssemblyFileVersion = "4.1.6" + let [] AssemblyInformationalVersion = "4.1.6" diff --git a/src/Paket.PowerShell/AssemblyInfo.fs b/src/Paket.PowerShell/AssemblyInfo.fs index 23a8c6072c..fe84c2d6bc 100644 --- a/src/Paket.PowerShell/AssemblyInfo.fs +++ b/src/Paket.PowerShell/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.5" - let [] AssemblyFileVersion = "4.1.5" - let [] AssemblyInformationalVersion = "4.1.5" + let [] AssemblyVersion = "4.1.6" + let [] AssemblyFileVersion = "4.1.6" + let [] AssemblyInformationalVersion = "4.1.6" diff --git a/src/Paket/AssemblyInfo.fs b/src/Paket/AssemblyInfo.fs index b9983d0cee..9031ffaa4b 100644 --- a/src/Paket/AssemblyInfo.fs +++ b/src/Paket/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.5" - let [] AssemblyFileVersion = "4.1.5" - let [] AssemblyInformationalVersion = "4.1.5" + let [] AssemblyVersion = "4.1.6" + let [] AssemblyFileVersion = "4.1.6" + let [] AssemblyInformationalVersion = "4.1.6" From e17a7a7524b9cc5c31556a64f151f7c1e5265c71 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Thu, 6 Apr 2017 10:58:11 +0200 Subject: [PATCH 08/45] Make Paket.Restore.targets be called in more situations --- .paket/Paket.Restore.targets | 6 +++--- Paket.sln | 1 + RELEASE_NOTES.md | 3 +++ src/Paket/embedded/Paket.Restore.targets | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.paket/Paket.Restore.targets b/.paket/Paket.Restore.targets index c05fe3d26b..ebcce7ffa6 100644 --- a/.paket/Paket.Restore.targets +++ b/.paket/Paket.Restore.targets @@ -12,7 +12,7 @@ $(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)" - + @@ -45,7 +45,7 @@ false - + $(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references @@ -57,7 +57,7 @@ - + diff --git a/Paket.sln b/Paket.sln index 47cb6868bb..4f3aeabb58 100644 --- a/Paket.sln +++ b/Paket.sln @@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{BF60 LICENSE.txt = LICENSE.txt paket.dependencies = paket.dependencies paket.lock = paket.lock + .paket\Paket.Restore.targets = .paket\Paket.Restore.targets nuget\paket.template = nuget\paket.template README.md = README.md RELEASE_NOTES.md = RELEASE_NOTES.md diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 847df0ab66..31adb62989 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 4.1.7 - 06.04.2017 +* BUGFIX: Make Paket.Restore.targets be called in more situations + #### 4.1.6 - 02.04.2017 * BUGFIX: Fix to handle weird malformed portable-only libraries - https://github.com/fsprojects/Paket/pull/2215 diff --git a/src/Paket/embedded/Paket.Restore.targets b/src/Paket/embedded/Paket.Restore.targets index 2c46715577..e48e078d65 100644 --- a/src/Paket/embedded/Paket.Restore.targets +++ b/src/Paket/embedded/Paket.Restore.targets @@ -12,7 +12,7 @@ $(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)" - + From 72f6ee816cab3ed8ee29da4052d285745c98f2cc Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Thu, 6 Apr 2017 11:02:03 +0200 Subject: [PATCH 09/45] Bump version to 4.1.7 --- src/Paket.Bootstrapper/Properties/AssemblyInfo.cs | 12 ++++++------ src/Paket.Core/AssemblyInfo.fs | 12 ++++++------ src/Paket.PowerShell/AssemblyInfo.fs | 12 ++++++------ src/Paket/AssemblyInfo.fs | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs index 02fd53406f..eae902144d 100644 --- a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs +++ b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs @@ -4,16 +4,16 @@ [assembly: AssemblyTitleAttribute("Paket.Bootstrapper")] [assembly: AssemblyProductAttribute("Paket")] [assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")] -[assembly: AssemblyVersionAttribute("4.1.6")] -[assembly: AssemblyFileVersionAttribute("4.1.6")] -[assembly: AssemblyInformationalVersionAttribute("4.1.6")] +[assembly: AssemblyVersionAttribute("4.1.7")] +[assembly: AssemblyFileVersionAttribute("4.1.7")] +[assembly: AssemblyInformationalVersionAttribute("4.1.7")] namespace System { internal static class AssemblyVersionInformation { internal const System.String AssemblyTitle = "Paket.Bootstrapper"; internal const System.String AssemblyProduct = "Paket"; internal const System.String AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories."; - internal const System.String AssemblyVersion = "4.1.6"; - internal const System.String AssemblyFileVersion = "4.1.6"; - internal const System.String AssemblyInformationalVersion = "4.1.6"; + internal const System.String AssemblyVersion = "4.1.7"; + internal const System.String AssemblyFileVersion = "4.1.7"; + internal const System.String AssemblyInformationalVersion = "4.1.7"; } } diff --git a/src/Paket.Core/AssemblyInfo.fs b/src/Paket.Core/AssemblyInfo.fs index 3d76fc135e..bab6bdcdf8 100644 --- a/src/Paket.Core/AssemblyInfo.fs +++ b/src/Paket.Core/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.6" - let [] AssemblyFileVersion = "4.1.6" - let [] AssemblyInformationalVersion = "4.1.6" + let [] AssemblyVersion = "4.1.7" + let [] AssemblyFileVersion = "4.1.7" + let [] AssemblyInformationalVersion = "4.1.7" diff --git a/src/Paket.PowerShell/AssemblyInfo.fs b/src/Paket.PowerShell/AssemblyInfo.fs index fe84c2d6bc..2d8d295744 100644 --- a/src/Paket.PowerShell/AssemblyInfo.fs +++ b/src/Paket.PowerShell/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.6" - let [] AssemblyFileVersion = "4.1.6" - let [] AssemblyInformationalVersion = "4.1.6" + let [] AssemblyVersion = "4.1.7" + let [] AssemblyFileVersion = "4.1.7" + let [] AssemblyInformationalVersion = "4.1.7" diff --git a/src/Paket/AssemblyInfo.fs b/src/Paket/AssemblyInfo.fs index 9031ffaa4b..756f680170 100644 --- a/src/Paket/AssemblyInfo.fs +++ b/src/Paket/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.6" - let [] AssemblyFileVersion = "4.1.6" - let [] AssemblyInformationalVersion = "4.1.6" + let [] AssemblyVersion = "4.1.7" + let [] AssemblyFileVersion = "4.1.7" + let [] AssemblyInformationalVersion = "4.1.7" From fd07e552ce73bedb5f3307bc4c1bedce7eec8f01 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sun, 9 Apr 2017 16:17:17 +0200 Subject: [PATCH 10/45] improve output of the outdated warning. --- src/Paket.Core/DependencyChangeDetection.fs | 64 ++++++++++++++------- src/Paket.Core/RestoreProcess.fs | 4 +- src/Paket.Core/UpdateProcess.fs | 2 +- src/Paket/Paket.fsproj | 4 +- 4 files changed, 50 insertions(+), 24 deletions(-) diff --git a/src/Paket.Core/DependencyChangeDetection.fs b/src/Paket.Core/DependencyChangeDetection.fs index 7d20c40356..bab62ae0f7 100644 --- a/src/Paket.Core/DependencyChangeDetection.fs +++ b/src/Paket.Core/DependencyChangeDetection.fs @@ -3,25 +3,46 @@ open Paket.Requirements open Paket.PackageResolver +type DependencyChangeType = + /// The restrictions changed + | RestrictionsChanged + /// The settigns of the package changed + | SettingsChanged + /// The Version in the LockFile doesn't match the spec in the dependencies file. + | VersionNotValid + /// Package from dependencies file was not found in lockfile + | PackageNotFoundInLockFile + /// Group from dependencies file was not found in lockfile + | GroupNotFoundInLockFile + /// Package from lock file was not found in dependencies file + | PackageNotFoundInDependenciesFile + let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFile:LockFile,strict) = let allTransitives groupName = lockFile.GetTransitiveDependencies groupName - let hasChanged groupName transitives (newRequirement:PackageRequirement) (originalPackage:ResolvedPackage) = + let getChanges groupName transitives (newRequirement:PackageRequirement) (originalPackage:ResolvedPackage) = let settingsChanged() = if newRequirement.Settings <> originalPackage.Settings then if newRequirement.Settings = { originalPackage.Settings with FrameworkRestrictions = AutoDetectFramework } then - false + [] elif newRequirement.Settings.FrameworkRestrictions <> originalPackage.Settings.FrameworkRestrictions then - transitives |> Seq.contains originalPackage.Name |> not - else true - else false + let isTransitive = transitives |> Seq.contains originalPackage.Name + if not isTransitive then + [RestrictionsChanged] + else [] + else [SettingsChanged] + else [] let requirementOk = - if strict then - newRequirement.VersionRequirement.IsInRange originalPackage.Version - else - newRequirement.IncludingPrereleases().VersionRequirement.IsInRange originalPackage.Version + let isInRange = + if strict then + newRequirement.VersionRequirement.IsInRange originalPackage.Version + else + newRequirement.IncludingPrereleases().VersionRequirement.IsInRange originalPackage.Version + if not isInRange then + [VersionNotValid] + else [] - (not requirementOk) || settingsChanged() + requirementOk @ settingsChanged() let added groupName transitives = match dependenciesFile.Groups |> Map.tryFind groupName with @@ -31,17 +52,19 @@ let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFil depsGroup.Packages |> Seq.map (fun d -> d.Name, { d with Settings = depsGroup.Options.Settings + d.Settings }) - |> Seq.filter (fun (name,dependenciesFilePackage) -> + |> Seq.map (fun (name,dependenciesFilePackage) -> + name, dependenciesFilePackage, match lockFileGroup with - | None -> true + | None -> [GroupNotFoundInLockFile] | Some group -> match group.Resolution.TryFind name with | Some lockFilePackage -> - hasChanged groupName transitives + getChanges groupName transitives { dependenciesFilePackage with Settings = depsGroup.Options.Settings + dependenciesFilePackage.Settings } { lockFilePackage with Settings = group.Options.Settings + lockFilePackage.Settings } - | _ -> true) - |> Seq.map (fun (p,_) -> groupName,p) + | _ -> [PackageNotFoundInLockFile]) + |> Seq.filter (fun (_,_, changes) -> changes.Length > 0) + |> Seq.map (fun (p,_, changes) -> groupName, p, changes) |> Set.ofSeq let modified groupName transitives = @@ -59,11 +82,12 @@ let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFil | Some pr -> let t = t.Value let t = { t with Settings = lockFile.GetGroup(groupName).Options.Settings + t.Settings } - if hasChanged groupName transitives pr t then - yield groupName, name // Modified - | _ -> yield groupName, name // Removed + yield groupName, name, getChanges groupName transitives pr t// then + // yield groupName, name // Modified + | _ -> yield groupName, name, [PackageNotFoundInDependenciesFile] // Removed ] - |> List.map (fun (g,p) -> lockFile.GetAllNormalizedDependenciesOf(g,p,lockFile.FileName)) + |> List.filter (fun (_,_, changes) -> changes.Length > 0) + |> List.map (fun (g,p, changes) -> lockFile.GetAllNormalizedDependenciesOf(g,p,lockFile.FileName) |> Seq.map (fun (a,b) -> a,b,changes)) |> Seq.concat |> Set.ofSeq @@ -195,7 +219,7 @@ let GetChanges(dependenciesFile,lockFile,strict) = let nuGetChanges = findNuGetChangesInDependenciesFile(dependenciesFile,lockFile,strict) let nuGetChangesPerGroup = nuGetChanges - |> Seq.groupBy fst + |> Seq.groupBy (fun (f,_,__) -> f) |> Map.ofSeq let remoteFileChanges = findRemoteFileChangesInDependenciesFile(dependenciesFile,lockFile) diff --git a/src/Paket.Core/RestoreProcess.fs b/src/Paket.Core/RestoreProcess.fs index 4d6f6e31f8..7374c00181 100644 --- a/src/Paket.Core/RestoreProcess.fs +++ b/src/Paket.Core/RestoreProcess.fs @@ -193,11 +193,13 @@ let Restore(dependenciesFileName,projectFile,force,group,referencesFileNames,ign LocalFile.overrideLockFile localFile lockFile,localFile,true if not hasLocalFile && not ignoreChecks then - let hasAnyChanges,_,_,_ = DependencyChangeDetection.GetChanges(dependenciesFile,lockFile,false) + let hasAnyChanges,nugetChanges,remoteFilechanges,hasChanges = DependencyChangeDetection.GetChanges(dependenciesFile,lockFile,false) let checkResponse = if failOnChecks then failwithf else traceWarnfn if hasAnyChanges then checkResponse "paket.dependencies and paket.lock are out of sync in %s.%sPlease run 'paket install' or 'paket update' to recompute the paket.lock file." lockFileName.Directory.FullName Environment.NewLine + for (group, package, changes) in nugetChanges do + traceWarnfn "Changes %A were detected in %s/%s" changes (group.ToString()) (package.ToString()) let groups = match group with diff --git a/src/Paket.Core/UpdateProcess.fs b/src/Paket.Core/UpdateProcess.fs index f4608fb198..9d9ed09171 100644 --- a/src/Paket.Core/UpdateProcess.fs +++ b/src/Paket.Core/UpdateProcess.fs @@ -109,7 +109,7 @@ let selectiveUpdate force getSha1 getSortedVersionsF getPackageDetailsF (lockFil dependenciesFile.Groups |> Map.filter hasChanges - nuGetChanges,groups + nuGetChanges |> Set.map (fun (f,s,_) -> f,s), groups let preferredVersions = DependencyChangeDetection.GetPreferredNuGetVersions(dependenciesFile,lockFile) diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index 810a954873..ad0ea01ad5 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -37,8 +37,8 @@ D:\temp\coreclrtest install C:\dev\src\Paket\integrationtests\scenarios\loading-scripts\dependencies-file-flag\temp - install --createnewbindingfiles - D:\temp\pakkit2 + restore -v + C:\PROJ\FAKE\ pdbonly From 14319bde16bb8a8cd30443c089b3ce83f928aa28 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sun, 9 Apr 2017 17:04:46 +0200 Subject: [PATCH 11/45] fixes #2222 , paket was not able to properly parse its own output. --- src/Paket.Core/FrameworkHandling.fs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Paket.Core/FrameworkHandling.fs b/src/Paket.Core/FrameworkHandling.fs index d21f947731..cc7e916852 100644 --- a/src/Paket.Core/FrameworkHandling.fs +++ b/src/Paket.Core/FrameworkHandling.fs @@ -129,6 +129,7 @@ module KnownAliases = ".netframework", "net" ".netcore", "netcore" "winrt", "netcore" + "netcoreapp", "netcore" "silverlight", "sl" "windowsphone", "wp" "windows", "win" @@ -364,8 +365,8 @@ module FrameworkDetection = | "netstandard14" -> Some(DotNetStandard DotNetStandardVersion.V1_4) | "netstandard15" -> Some(DotNetStandard DotNetStandardVersion.V1_5) | "netstandard16" -> Some(DotNetStandard DotNetStandardVersion.V1_6) - | "netcoreapp10" -> Some (DotNetCore DotNetCoreVersion.V1_0) - | "netcoreapp11" -> Some (DotNetCore DotNetCoreVersion.V1_1) + | "netcore10" | "netcoreapp10" -> Some (DotNetCore DotNetCoreVersion.V1_0) + | "netcore11" | "netcoreapp11" -> Some (DotNetCore DotNetCoreVersion.V1_1) | v when v.StartsWith "netstandard" -> Some(DotNetStandard DotNetStandardVersion.V1_6) | _ -> None result) From 3d5551a1d8ce98c47fd67610978b676508426f31 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sun, 9 Apr 2017 17:12:03 +0200 Subject: [PATCH 12/45] at least log (maybe even fail?) in such edge cases --- src/Paket.Core/Requirements.fs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Paket.Core/Requirements.fs b/src/Paket.Core/Requirements.fs index c12f2f88da..3b71d2df02 100644 --- a/src/Paket.Core/Requirements.fs +++ b/src/Paket.Core/Requirements.fs @@ -4,6 +4,7 @@ open System open Paket open Paket.Domain open Paket.PackageSources +open Paket.Logging [] type FrameworkRestriction = @@ -60,13 +61,17 @@ let parseRestrictions(text:string) = | None -> if PlatformMatching.extractPlatforms framework |> List.isEmpty |> not then yield FrameworkRestriction.Portable framework + else + traceErrorfn "Could not parse framework '%s'. Try to update or install again or report a paket bug." framework | Some x -> if operatorSplit.[0] = ">=" then if operatorSplit.Length < 4 then yield FrameworkRestriction.AtLeast x else - match FrameworkDetection.Extract(operatorSplit.[3]) with - | None -> () + let item = operatorSplit.[3] + match FrameworkDetection.Extract(item) with + | None -> + traceErrorfn "Could not parse second framework of between operator '%s'. Try to update or install again or report a paket bug." item | Some y -> yield FrameworkRestriction.Between(x,y) else yield FrameworkRestriction.Exactly x] From 36a32694128bee3e01212ec582cd7a6c55d4b7b5 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sun, 9 Apr 2017 17:15:58 +0200 Subject: [PATCH 13/45] of course the logging immediatly found another bug... --- src/Paket.Core/FrameworkHandling.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Paket.Core/FrameworkHandling.fs b/src/Paket.Core/FrameworkHandling.fs index cc7e916852..fec4b353c2 100644 --- a/src/Paket.Core/FrameworkHandling.fs +++ b/src/Paket.Core/FrameworkHandling.fs @@ -181,7 +181,7 @@ type FrameworkIdentifier = | UAP v -> "uap" + v.ShortString() | XamarinMac -> "xamarinmac" | Windows v -> "win" + v - | WindowsPhoneSilverlight v -> "wp" + v + | WindowsPhoneSilverlight v -> "wp" + v.Replace("v","").Replace(".","") | WindowsPhoneApp v -> "wpa" + v | Silverlight v -> "sl" + v.Replace("v","").Replace(".","") From 28e98e54e0ecb08cc1957b2503b22d3ef1bb214f Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sun, 9 Apr 2017 17:44:24 +0200 Subject: [PATCH 14/45] fail directly as this finds bugs... but ignore nuget texts otherwise we fail whenever they introduce something. --- src/Paket.Core/Files/LockFile.fs | 2 +- src/Paket.Core/Files/ReferencesFile.fs | 4 +++- src/Paket.Core/NuGetV3.fs | 2 +- src/Paket.Core/NugetConvert.fs | 2 +- src/Paket.Core/PackageResolver.fs | 2 +- .../Parsers/DependenciesFileParser.fs | 2 +- src/Paket.Core/Requirements.fs | 18 ++++++++++++++---- src/Paket/Paket.fsproj | 6 +++--- 8 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/Paket.Core/Files/LockFile.fs b/src/Paket.Core/Files/LockFile.fs index 4f0d8f2815..b80181b811 100644 --- a/src/Paket.Core/Files/LockFile.fs +++ b/src/Paket.Core/Files/LockFile.fs @@ -274,7 +274,7 @@ module LockFileParser = | x -> failwithf "Unknown copy_content_to_output_dir settings: %A" x InstallOption(CopyContentToOutputDir(setting)) - | _, String.StartsWith "FRAMEWORK:" trimmed -> InstallOption(FrameworkRestrictions(FrameworkRestrictionList (trimmed.Trim() |> Requirements.parseRestrictions))) + | _, String.StartsWith "FRAMEWORK:" trimmed -> InstallOption(FrameworkRestrictions(FrameworkRestrictionList (trimmed.Trim() |> Requirements.parseRestrictions true))) | _, String.StartsWith "CONDITION:" trimmed -> InstallOption(ReferenceCondition(trimmed.Trim().ToUpper())) | _, String.StartsWith "CONTENT:" trimmed -> let setting = diff --git a/src/Paket.Core/Files/ReferencesFile.fs b/src/Paket.Core/Files/ReferencesFile.fs index e0c48d51cd..19abd51d95 100644 --- a/src/Paket.Core/Files/ReferencesFile.fs +++ b/src/Paket.Core/Files/ReferencesFile.fs @@ -124,7 +124,9 @@ type ReferencesFile = static member FromFile(fileName : string) = let lines = File.ReadAllLines(fileName) - { ReferencesFile.FromLines lines with FileName = fileName } + try + { ReferencesFile.FromLines lines with FileName = fileName } + with e -> raise <| new Exception(sprintf "Could not parse reference file '%s': %s" fileName e.Message, e) member this.AddNuGetReference(groupName, packageName : PackageName, copyLocal: bool, importTargets: bool, frameworkRestrictions, includeVersionInPath, omitContent : bool, createBindingRedirects, referenceCondition) = let package: PackageInstallSettings = diff --git a/src/Paket.Core/NuGetV3.fs b/src/Paket.Core/NuGetV3.fs index 1db804321e..ae20914dc3 100644 --- a/src/Paket.Core/NuGetV3.fs +++ b/src/Paket.Core/NuGetV3.fs @@ -245,7 +245,7 @@ let getPackageDetails (source:NugetV3Source) (packageName:PackageName) (version: let targetFramework = match targetFramework with | null -> [] - | x -> Requirements.parseRestrictions x + | x -> Requirements.parseRestrictions false x (PackageName dep.Id), (VersionRequirement.Parse dep.Range), targetFramework) |> Seq.toList let unlisted = diff --git a/src/Paket.Core/NugetConvert.fs b/src/Paket.Core/NugetConvert.fs index 75175ffd89..737c000c51 100644 --- a/src/Paket.Core/NugetConvert.fs +++ b/src/Paket.Core/NugetConvert.fs @@ -259,7 +259,7 @@ let createDependenciesFileR (rootDirectory : DirectoryInfo) nugetEnv mode = let latestVersion, _ = versions |> List.maxBy fst let restrictions = match versions with - | [ version, targetFramework ] -> targetFramework |> Option.toList |> List.collect Requirements.parseRestrictions + | [ version, targetFramework ] -> targetFramework |> Option.toList |> List.collect (Requirements.parseRestrictions false) | _ -> [] name, latestVersion, restrictions) diff --git a/src/Paket.Core/PackageResolver.fs b/src/Paket.Core/PackageResolver.fs index 9c507f8d9a..084ee2e4da 100644 --- a/src/Paket.Core/PackageResolver.fs +++ b/src/Paket.Core/PackageResolver.fs @@ -651,7 +651,7 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate let rec step (stage:Stage) (stackpack:StackPack) compatibleVersions (flags:StepFlags) = - let fuseConflicts currentConflict priorConflictSteps = + let inline fuseConflicts currentConflict priorConflictSteps = match currentConflict, priorConflictSteps with | currentConflict, (lastConflict,lastStep,lastRequirement,lastCompatibleVersions,lastFlags)::priorConflictSteps -> let continueConflict = diff --git a/src/Paket.Core/Parsers/DependenciesFileParser.fs b/src/Paket.Core/Parsers/DependenciesFileParser.fs index 76c71549fb..b73954bf70 100644 --- a/src/Paket.Core/Parsers/DependenciesFileParser.fs +++ b/src/Paket.Core/Parsers/DependenciesFileParser.fs @@ -301,7 +301,7 @@ module DependenciesFileParser = if text = "auto-detect" then Some (ParserOptions(ParserOption.AutodetectFrameworkRestrictions)) else - let restrictions = Requirements.parseRestrictions text + let restrictions = Requirements.parseRestrictions true text if String.IsNullOrWhiteSpace text |> not && List.isEmpty restrictions then failwithf "Could not parse framework restriction \"%s\"" text diff --git a/src/Paket.Core/Requirements.fs b/src/Paket.Core/Requirements.fs index 3b71d2df02..478680650a 100644 --- a/src/Paket.Core/Requirements.fs +++ b/src/Paket.Core/Requirements.fs @@ -42,7 +42,17 @@ let getRestrictionList (frameworkRestrictions:FrameworkRestrictions) = | FrameworkRestrictionList list -> list | AutoDetectFramework -> failwith "The framework restriction could not be determined." -let parseRestrictions(text:string) = +let parseRestrictions failImmediatly (text:string) = + let handleError = + if failImmediatly then + failwith + else + if verbose then + (fun s -> + traceError s + traceVerbose Environment.StackTrace + ) + else traceError let text = // workaround missing spaces text.Replace("<=","<= ").Replace(">=",">= ").Replace("=","= ") @@ -62,7 +72,7 @@ let parseRestrictions(text:string) = if PlatformMatching.extractPlatforms framework |> List.isEmpty |> not then yield FrameworkRestriction.Portable framework else - traceErrorfn "Could not parse framework '%s'. Try to update or install again or report a paket bug." framework + handleError <| sprintf "Could not parse framework '%s'. Try to update or install again or report a paket bug." framework | Some x -> if operatorSplit.[0] = ">=" then if operatorSplit.Length < 4 then @@ -71,7 +81,7 @@ let parseRestrictions(text:string) = let item = operatorSplit.[3] match FrameworkDetection.Extract(item) with | None -> - traceErrorfn "Could not parse second framework of between operator '%s'. Try to update or install again or report a paket bug." item + handleError <| sprintf "Could not parse second framework of between operator '%s'. Try to update or install again or report a paket bug." item | Some y -> yield FrameworkRestriction.Between(x,y) else yield FrameworkRestriction.Exactly x] @@ -645,7 +655,7 @@ type InstallSettings = | _ -> None FrameworkRestrictions = match getPair "framework" with - | Some s -> FrameworkRestrictionList(parseRestrictions s) + | Some s -> FrameworkRestrictionList(parseRestrictions true s) | _ -> FrameworkRestrictionList [] OmitContent = match getPair "content" with diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index ad0ea01ad5..48b5e807d5 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -37,7 +37,7 @@ D:\temp\coreclrtest install C:\dev\src\Paket\integrationtests\scenarios\loading-scripts\dependencies-file-flag\temp - restore -v + install C:\PROJ\FAKE\ @@ -68,8 +68,8 @@ D:\temp\unlisted install D:\temp\PaketWithProblem1 - restore - D:\temp\watchr2 + update + C:\PROJ\FAKE\ 11 From fb3096e1b95bf93bca74188dd847cf78fe4625c5 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sun, 9 Apr 2017 17:50:41 +0200 Subject: [PATCH 15/45] update tests --- .../DependenciesFile/DependencyChangesSpecs.fs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs b/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs index 8d5be5970a..a0ad98eb34 100644 --- a/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs +++ b/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs @@ -61,7 +61,7 @@ nuget Castle.Windsor-log4net""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions(cfg,lockFile) newDependencies |> Map.filter (fun k v -> not <| changedDependencies.Contains(k)) @@ -98,7 +98,7 @@ nuget NUnit""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions (cfg,lockFile) let expected = @@ -146,7 +146,7 @@ nuget Castle.Windsor-log4net >= 3.3.0""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions (cfg,lockFile) let expected = @@ -193,7 +193,7 @@ nuget Castle.Windsor-log4net >= 3.4.0""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions (cfg,lockFile) newDependencies @@ -297,7 +297,7 @@ nuget Caliburn.Micro !~> 2.0.2""" let lockFile = LockFile.Parse("",toLines lockFileData) let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) changedDependencies.Count |> shouldEqual 1 - (changedDependencies |> Seq.head) |> shouldEqual (Constants.MainDependencyGroup, PackageName "Caliburn.Micro") + (changedDependencies |> Seq.head) |> shouldEqual (Constants.MainDependencyGroup, PackageName "Caliburn.Micro",[Paket.DependencyChangeDetection.DependencyChangeType.PackageNotFoundInLockFile]) [] let ``should detect if nothing changes in github dependency``() = From 2728beaf02e8d7eca452cfd44b0e24136b91e482 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sun, 9 Apr 2017 18:03:47 +0200 Subject: [PATCH 16/45] apparently the other way around is better (as we don't have to change behavior/tests) --- src/Paket.Core/FrameworkHandling.fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Paket.Core/FrameworkHandling.fs b/src/Paket.Core/FrameworkHandling.fs index fec4b353c2..f280dd820f 100644 --- a/src/Paket.Core/FrameworkHandling.fs +++ b/src/Paket.Core/FrameworkHandling.fs @@ -181,7 +181,7 @@ type FrameworkIdentifier = | UAP v -> "uap" + v.ShortString() | XamarinMac -> "xamarinmac" | Windows v -> "win" + v - | WindowsPhoneSilverlight v -> "wp" + v.Replace("v","").Replace(".","") + | WindowsPhoneSilverlight v -> "wp" + v | WindowsPhoneApp v -> "wpa" + v | Silverlight v -> "sl" + v.Replace("v","").Replace(".","") @@ -350,8 +350,8 @@ module FrameworkDetection = | "sl5" | "sl50" -> Some (Silverlight "v5.0") | "win8" | "windows8" | "win80" | "netcore45" | "win" | "winv45" -> Some (Windows "v4.5") | "win81" | "windows81" | "netcore46" | "netcore451" | "winv451" -> Some (Windows "v4.5.1") - | "wp7" | "wp70" | "sl4-wp7"| "sl4-wp70" -> Some (WindowsPhoneSilverlight "v7.0") - | "wp71" | "sl4-wp71" | "sl4-wp" -> Some (WindowsPhoneSilverlight "v7.1") + | "wp7" | "wp70" | "wpv7" | "wpv70" | "sl4-wp7"| "sl4-wp70" -> Some (WindowsPhoneSilverlight "v7.0") + | "wp71" | "wpv71" | "sl4-wp71" | "sl4-wp" -> Some (WindowsPhoneSilverlight "v7.1") | "wpa00" | "wpa" | "wpa81" | "wpav81" | "wpapp81" | "wpapp" -> Some (WindowsPhoneApp "v8.1") | "wp8" | "wp80" | "wpv80" -> Some (WindowsPhoneSilverlight "v8.0") | "wp81" | "wpv81" -> Some (WindowsPhoneSilverlight "v8.1") From 6cb4a35a4c69650cecb0983adf272ed7d775ae37 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sun, 9 Apr 2017 18:09:34 +0200 Subject: [PATCH 17/45] some cleanup... --- src/Paket.Core/DependencyChangeDetection.fs | 3 +-- src/Paket.Core/FrameworkHandling.fs | 4 ++-- src/Paket.Core/Requirements.fs | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Paket.Core/DependencyChangeDetection.fs b/src/Paket.Core/DependencyChangeDetection.fs index bab62ae0f7..3d99e9e39b 100644 --- a/src/Paket.Core/DependencyChangeDetection.fs +++ b/src/Paket.Core/DependencyChangeDetection.fs @@ -82,8 +82,7 @@ let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFil | Some pr -> let t = t.Value let t = { t with Settings = lockFile.GetGroup(groupName).Options.Settings + t.Settings } - yield groupName, name, getChanges groupName transitives pr t// then - // yield groupName, name // Modified + yield groupName, name, getChanges groupName transitives pr t // Modified | _ -> yield groupName, name, [PackageNotFoundInDependenciesFile] // Removed ] |> List.filter (fun (_,_, changes) -> changes.Length > 0) diff --git a/src/Paket.Core/FrameworkHandling.fs b/src/Paket.Core/FrameworkHandling.fs index f280dd820f..a37a99eb25 100644 --- a/src/Paket.Core/FrameworkHandling.fs +++ b/src/Paket.Core/FrameworkHandling.fs @@ -365,8 +365,8 @@ module FrameworkDetection = | "netstandard14" -> Some(DotNetStandard DotNetStandardVersion.V1_4) | "netstandard15" -> Some(DotNetStandard DotNetStandardVersion.V1_5) | "netstandard16" -> Some(DotNetStandard DotNetStandardVersion.V1_6) - | "netcore10" | "netcoreapp10" -> Some (DotNetCore DotNetCoreVersion.V1_0) - | "netcore11" | "netcoreapp11" -> Some (DotNetCore DotNetCoreVersion.V1_1) + | "netcore10" -> Some (DotNetCore DotNetCoreVersion.V1_0) + | "netcore11" -> Some (DotNetCore DotNetCoreVersion.V1_1) | v when v.StartsWith "netstandard" -> Some(DotNetStandard DotNetStandardVersion.V1_6) | _ -> None result) diff --git a/src/Paket.Core/Requirements.fs b/src/Paket.Core/Requirements.fs index 478680650a..14cd85f21c 100644 --- a/src/Paket.Core/Requirements.fs +++ b/src/Paket.Core/Requirements.fs @@ -50,8 +50,7 @@ let parseRestrictions failImmediatly (text:string) = if verbose then (fun s -> traceError s - traceVerbose Environment.StackTrace - ) + traceVerbose Environment.StackTrace) else traceError let text = // workaround missing spaces From b1a6271662b229abd7a333f6aaa4a767a0d76b0f Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 9 Apr 2017 18:35:17 +0200 Subject: [PATCH 18/45] remove flaky tests --- .../Paket.IntegrationTests/GroupSpecs.fs | 20 ----------- .../LoadingScriptGenerationTests.fs | 2 +- .../Paket.IntegrationTests.fsproj | 1 - .../UpdateGroupsSpecs.fs | 22 ------------- .../UpdatePackageSpecs.fs | 33 ------------------- .../before/paket.dependencies | 10 ------ .../before/paket.lock | 11 ------- .../before/paket.dependencies | 9 ----- 8 files changed, 1 insertion(+), 107 deletions(-) delete mode 100644 integrationtests/Paket.IntegrationTests/GroupSpecs.fs delete mode 100644 integrationtests/scenarios/i001018-legacy-groups-update/before/paket.dependencies delete mode 100644 integrationtests/scenarios/i001018-legacy-groups-update/before/paket.lock delete mode 100644 integrationtests/scenarios/i001018-legacy-groups/before/paket.dependencies diff --git a/integrationtests/Paket.IntegrationTests/GroupSpecs.fs b/integrationtests/Paket.IntegrationTests/GroupSpecs.fs deleted file mode 100644 index 817698ba27..0000000000 --- a/integrationtests/Paket.IntegrationTests/GroupSpecs.fs +++ /dev/null @@ -1,20 +0,0 @@ -module Paket.IntegrationTests.GroupsSpecs - -open Fake -open System -open NUnit.Framework -open FsUnit -open System -open System.IO -open System.Diagnostics - -[] -let ``#1018 should resolve Newtonsoft.Json from two groups``() = - update "i001018-legacy-groups" |> ignore - let path = scenarioTempPath "i001018-legacy-groups" - - File.Exists(Path.Combine(path,"packages","Newtonsoft.Json","Newtonsoft.Json.7.0.1.nupkg")) - |> shouldEqual true - - File.Exists(Path.Combine(path,"packages","legacy","Newtonsoft.Json","Newtonsoft.Json.6.0.8.nupkg")) - |> shouldEqual true \ No newline at end of file diff --git a/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs b/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs index 77e7770022..926d95bc9c 100644 --- a/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs +++ b/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs @@ -210,7 +210,7 @@ let ``generates script on install`` () = [] let ``issue 2156 netstandard`` () = - let scenario = "issue-2156-netstandard" + let scenario = "issue-2156" paket "install" scenario |> ignore directPaket "generate-load-scripts" scenario |> ignore // note: no assert for now, I don't know what we are exactly expecting \ No newline at end of file diff --git a/integrationtests/Paket.IntegrationTests/Paket.IntegrationTests.fsproj b/integrationtests/Paket.IntegrationTests/Paket.IntegrationTests.fsproj index d705f3e672..b8a2b17323 100644 --- a/integrationtests/Paket.IntegrationTests/Paket.IntegrationTests.fsproj +++ b/integrationtests/Paket.IntegrationTests/Paket.IntegrationTests.fsproj @@ -103,7 +103,6 @@ - diff --git a/integrationtests/Paket.IntegrationTests/UpdateGroupsSpecs.fs b/integrationtests/Paket.IntegrationTests/UpdateGroupsSpecs.fs index 9db9e1c4f9..bbe9db2f2f 100644 --- a/integrationtests/Paket.IntegrationTests/UpdateGroupsSpecs.fs +++ b/integrationtests/Paket.IntegrationTests/UpdateGroupsSpecs.fs @@ -10,28 +10,6 @@ open Paket open Paket.Domain -[] -let ``#1018 update main group``() = - paket "update group Main" "i001018-legacy-groups-update" |> ignore - let lockFile = LockFile.LoadFrom(Path.Combine(scenarioTempPath "i001018-legacy-groups-update","paket.lock")) - lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "Newtonsoft.Json"].Version - |> shouldBeGreaterThan (SemVer.Parse "6.0.3") - lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "NUnit"].Version - |> shouldBeGreaterThan (SemVer.Parse "2.6.1") - lockFile.Groups.[GroupName "Legacy"].Resolution.[PackageName "Newtonsoft.Json"].Version - |> shouldEqual (SemVer.Parse "5.0.2") - -[] -let ``#1018 update group legacy``() = - paket "update group leGacy" "i001018-legacy-groups-update" |> ignore - let lockFile = LockFile.LoadFrom(Path.Combine(scenarioTempPath "i001018-legacy-groups-update","paket.lock")) - lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "Newtonsoft.Json"].Version - |> shouldEqual (SemVer.Parse "6.0.3") - lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "NUnit"].Version - |> shouldEqual (SemVer.Parse "2.6.1") - lockFile.Groups.[GroupName "Legacy"].Resolution.[PackageName "Newtonsoft.Json"].Version - |> shouldBeGreaterThan (SemVer.Parse "5.0.2") - [] let ``#1711 update main group with correct source``() = update "i001711-wrong-source" |> ignore diff --git a/integrationtests/Paket.IntegrationTests/UpdatePackageSpecs.fs b/integrationtests/Paket.IntegrationTests/UpdatePackageSpecs.fs index 747ef61a32..077fc06a4c 100644 --- a/integrationtests/Paket.IntegrationTests/UpdatePackageSpecs.fs +++ b/integrationtests/Paket.IntegrationTests/UpdatePackageSpecs.fs @@ -21,39 +21,6 @@ open Paket open Paket.Domain open Paket.Requirements -[] -let ``#1018 update package in main group``() = - paket "update nuget Newtonsoft.json" "i001018-legacy-groups-update" |> ignore - let lockFile = LockFile.LoadFrom(Path.Combine(scenarioTempPath "i001018-legacy-groups-update","paket.lock")) - lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "Newtonsoft.Json"].Version - |> shouldBeGreaterThan (SemVer.Parse "6.0.3") - lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "NUnit"].Version - |> shouldEqual (SemVer.Parse "2.6.1") - lockFile.Groups.[GroupName "Legacy"].Resolution.[PackageName "Newtonsoft.Json"].Version - |> shouldEqual (SemVer.Parse "5.0.2") - -[] -let ``#1018 update package in explicit main group``() = - paket "update nuget Newtonsoft.json group Main" "i001018-legacy-groups-update" |> ignore - let lockFile = LockFile.LoadFrom(Path.Combine(scenarioTempPath "i001018-legacy-groups-update","paket.lock")) - lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "Newtonsoft.Json"].Version - |> shouldBeGreaterThan (SemVer.Parse "6.0.3") - lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "NUnit"].Version - |> shouldEqual (SemVer.Parse "2.6.1") - lockFile.Groups.[GroupName "Legacy"].Resolution.[PackageName "Newtonsoft.Json"].Version - |> shouldEqual (SemVer.Parse "5.0.2") - -[] -let ``#1018 update package in group``() = - paket "update nuget Newtonsoft.json group leGacy" "i001018-legacy-groups-update" |> ignore - let lockFile = LockFile.LoadFrom(Path.Combine(scenarioTempPath "i001018-legacy-groups-update","paket.lock")) - lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "Newtonsoft.Json"].Version - |> shouldEqual (SemVer.Parse "6.0.3") - lockFile.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "NUnit"].Version - |> shouldEqual (SemVer.Parse "2.6.1") - lockFile.Groups.[GroupName "Legacy"].Resolution.[PackageName "Newtonsoft.Json"].Version - |> shouldBeGreaterThan (SemVer.Parse "5.0.2") - [] let ``#1178 update specific package``() = paket "update nuget NUnit" "i001178-update-with-regex" |> ignore diff --git a/integrationtests/scenarios/i001018-legacy-groups-update/before/paket.dependencies b/integrationtests/scenarios/i001018-legacy-groups-update/before/paket.dependencies deleted file mode 100644 index b243914f71..0000000000 --- a/integrationtests/scenarios/i001018-legacy-groups-update/before/paket.dependencies +++ /dev/null @@ -1,10 +0,0 @@ -source https://nuget.org/api/v2 - -nuget Newtonsoft.Json -nuget NUnit - -group Legacy - -source https://nuget.org/api/v2 - -nuget Newtonsoft.Json \ No newline at end of file diff --git a/integrationtests/scenarios/i001018-legacy-groups-update/before/paket.lock b/integrationtests/scenarios/i001018-legacy-groups-update/before/paket.lock deleted file mode 100644 index 9b6c8e3adb..0000000000 --- a/integrationtests/scenarios/i001018-legacy-groups-update/before/paket.lock +++ /dev/null @@ -1,11 +0,0 @@ -NUGET - remote: https://nuget.org/api/v2 - specs: - Newtonsoft.Json (6.0.3) - NUnit (2.6.1) - -GROUP Legacy -NUGET - remote: https://nuget.org/api/v2 - specs: - Newtonsoft.Json (5.0.2) diff --git a/integrationtests/scenarios/i001018-legacy-groups/before/paket.dependencies b/integrationtests/scenarios/i001018-legacy-groups/before/paket.dependencies deleted file mode 100644 index b9b4d47650..0000000000 --- a/integrationtests/scenarios/i001018-legacy-groups/before/paket.dependencies +++ /dev/null @@ -1,9 +0,0 @@ -source https://nuget.org/api/v2 - -nuget Newtonsoft.Json 7.0.1 - -group Legacy - -source https://nuget.org/api/v2 - -nuget Newtonsoft.Json 6.0.8 \ No newline at end of file From bce8a15acd31d48f51e270352afc31ef09a6b153 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 9 Apr 2017 18:36:18 +0200 Subject: [PATCH 19/45] RELEASE_NOTES --- RELEASE_NOTES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 31adb62989..242b4e7a9c 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 4.1.8 - 09.04.2017 +* BUGFIX: Improved output of the outdated warning and fix underlying bug - https://github.com/fsprojects/Paket/pull/2223 + #### 4.1.7 - 06.04.2017 * BUGFIX: Make Paket.Restore.targets be called in more situations From 978130466f0a744ce38692a5e17971f8ef92fe14 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 9 Apr 2017 18:41:32 +0200 Subject: [PATCH 20/45] remove flaky test --- .../Paket.IntegrationTests.fsproj | 1 - src/Paket.Bootstrapper/Properties/AssemblyInfo.cs | 12 ++++++------ src/Paket.Core/AssemblyInfo.fs | 12 ++++++------ src/Paket.PowerShell/AssemblyInfo.fs | 12 ++++++------ src/Paket/AssemblyInfo.fs | 12 ++++++------ 5 files changed, 24 insertions(+), 25 deletions(-) diff --git a/integrationtests/Paket.IntegrationTests/Paket.IntegrationTests.fsproj b/integrationtests/Paket.IntegrationTests/Paket.IntegrationTests.fsproj index b8a2b17323..6aae1a7de2 100644 --- a/integrationtests/Paket.IntegrationTests/Paket.IntegrationTests.fsproj +++ b/integrationtests/Paket.IntegrationTests/Paket.IntegrationTests.fsproj @@ -114,7 +114,6 @@ - diff --git a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs index eae902144d..e3ebf9e8f8 100644 --- a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs +++ b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs @@ -4,16 +4,16 @@ [assembly: AssemblyTitleAttribute("Paket.Bootstrapper")] [assembly: AssemblyProductAttribute("Paket")] [assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")] -[assembly: AssemblyVersionAttribute("4.1.7")] -[assembly: AssemblyFileVersionAttribute("4.1.7")] -[assembly: AssemblyInformationalVersionAttribute("4.1.7")] +[assembly: AssemblyVersionAttribute("4.1.8")] +[assembly: AssemblyFileVersionAttribute("4.1.8")] +[assembly: AssemblyInformationalVersionAttribute("4.1.8")] namespace System { internal static class AssemblyVersionInformation { internal const System.String AssemblyTitle = "Paket.Bootstrapper"; internal const System.String AssemblyProduct = "Paket"; internal const System.String AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories."; - internal const System.String AssemblyVersion = "4.1.7"; - internal const System.String AssemblyFileVersion = "4.1.7"; - internal const System.String AssemblyInformationalVersion = "4.1.7"; + internal const System.String AssemblyVersion = "4.1.8"; + internal const System.String AssemblyFileVersion = "4.1.8"; + internal const System.String AssemblyInformationalVersion = "4.1.8"; } } diff --git a/src/Paket.Core/AssemblyInfo.fs b/src/Paket.Core/AssemblyInfo.fs index bab6bdcdf8..a87c3f7c1e 100644 --- a/src/Paket.Core/AssemblyInfo.fs +++ b/src/Paket.Core/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.7" - let [] AssemblyFileVersion = "4.1.7" - let [] AssemblyInformationalVersion = "4.1.7" + let [] AssemblyVersion = "4.1.8" + let [] AssemblyFileVersion = "4.1.8" + let [] AssemblyInformationalVersion = "4.1.8" diff --git a/src/Paket.PowerShell/AssemblyInfo.fs b/src/Paket.PowerShell/AssemblyInfo.fs index 2d8d295744..3c69466294 100644 --- a/src/Paket.PowerShell/AssemblyInfo.fs +++ b/src/Paket.PowerShell/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.7" - let [] AssemblyFileVersion = "4.1.7" - let [] AssemblyInformationalVersion = "4.1.7" + let [] AssemblyVersion = "4.1.8" + let [] AssemblyFileVersion = "4.1.8" + let [] AssemblyInformationalVersion = "4.1.8" diff --git a/src/Paket/AssemblyInfo.fs b/src/Paket/AssemblyInfo.fs index 756f680170..bf82109367 100644 --- a/src/Paket/AssemblyInfo.fs +++ b/src/Paket/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.7" - let [] AssemblyFileVersion = "4.1.7" - let [] AssemblyInformationalVersion = "4.1.7" + let [] AssemblyVersion = "4.1.8" + let [] AssemblyFileVersion = "4.1.8" + let [] AssemblyInformationalVersion = "4.1.8" From 4edb04dbb8d506f922ebf604510b317b94c22019 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 9 Apr 2017 18:54:49 +0200 Subject: [PATCH 21/45] Revert "Merge branch 'fix_annoying_warning_2222' of https://github.com/matthid/Paket" This reverts commit d03f60d232bdf50c27893391f9446ca7cc3e9a1d, reversing changes made to b1a6271662b229abd7a333f6aaa4a767a0d76b0f. --- src/Paket.Core/DependencyChangeDetection.fs | 63 ++++++------------- src/Paket.Core/Files/LockFile.fs | 2 +- src/Paket.Core/Files/ReferencesFile.fs | 4 +- src/Paket.Core/FrameworkHandling.fs | 9 ++- src/Paket.Core/NuGetV3.fs | 2 +- src/Paket.Core/NugetConvert.fs | 2 +- src/Paket.Core/PackageResolver.fs | 2 +- .../Parsers/DependenciesFileParser.fs | 2 +- src/Paket.Core/Requirements.fs | 22 ++----- src/Paket.Core/RestoreProcess.fs | 4 +- src/Paket.Core/UpdateProcess.fs | 2 +- src/Paket/Paket.fsproj | 8 +-- .../DependencyChangesSpecs.fs | 10 +-- 13 files changed, 45 insertions(+), 87 deletions(-) diff --git a/src/Paket.Core/DependencyChangeDetection.fs b/src/Paket.Core/DependencyChangeDetection.fs index 3d99e9e39b..7d20c40356 100644 --- a/src/Paket.Core/DependencyChangeDetection.fs +++ b/src/Paket.Core/DependencyChangeDetection.fs @@ -3,46 +3,25 @@ open Paket.Requirements open Paket.PackageResolver -type DependencyChangeType = - /// The restrictions changed - | RestrictionsChanged - /// The settigns of the package changed - | SettingsChanged - /// The Version in the LockFile doesn't match the spec in the dependencies file. - | VersionNotValid - /// Package from dependencies file was not found in lockfile - | PackageNotFoundInLockFile - /// Group from dependencies file was not found in lockfile - | GroupNotFoundInLockFile - /// Package from lock file was not found in dependencies file - | PackageNotFoundInDependenciesFile - let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFile:LockFile,strict) = let allTransitives groupName = lockFile.GetTransitiveDependencies groupName - let getChanges groupName transitives (newRequirement:PackageRequirement) (originalPackage:ResolvedPackage) = + let hasChanged groupName transitives (newRequirement:PackageRequirement) (originalPackage:ResolvedPackage) = let settingsChanged() = if newRequirement.Settings <> originalPackage.Settings then if newRequirement.Settings = { originalPackage.Settings with FrameworkRestrictions = AutoDetectFramework } then - [] + false elif newRequirement.Settings.FrameworkRestrictions <> originalPackage.Settings.FrameworkRestrictions then - let isTransitive = transitives |> Seq.contains originalPackage.Name - if not isTransitive then - [RestrictionsChanged] - else [] - else [SettingsChanged] - else [] + transitives |> Seq.contains originalPackage.Name |> not + else true + else false let requirementOk = - let isInRange = - if strict then - newRequirement.VersionRequirement.IsInRange originalPackage.Version - else - newRequirement.IncludingPrereleases().VersionRequirement.IsInRange originalPackage.Version - if not isInRange then - [VersionNotValid] - else [] + if strict then + newRequirement.VersionRequirement.IsInRange originalPackage.Version + else + newRequirement.IncludingPrereleases().VersionRequirement.IsInRange originalPackage.Version - requirementOk @ settingsChanged() + (not requirementOk) || settingsChanged() let added groupName transitives = match dependenciesFile.Groups |> Map.tryFind groupName with @@ -52,19 +31,17 @@ let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFil depsGroup.Packages |> Seq.map (fun d -> d.Name, { d with Settings = depsGroup.Options.Settings + d.Settings }) - |> Seq.map (fun (name,dependenciesFilePackage) -> - name, dependenciesFilePackage, + |> Seq.filter (fun (name,dependenciesFilePackage) -> match lockFileGroup with - | None -> [GroupNotFoundInLockFile] + | None -> true | Some group -> match group.Resolution.TryFind name with | Some lockFilePackage -> - getChanges groupName transitives + hasChanged groupName transitives { dependenciesFilePackage with Settings = depsGroup.Options.Settings + dependenciesFilePackage.Settings } { lockFilePackage with Settings = group.Options.Settings + lockFilePackage.Settings } - | _ -> [PackageNotFoundInLockFile]) - |> Seq.filter (fun (_,_, changes) -> changes.Length > 0) - |> Seq.map (fun (p,_, changes) -> groupName, p, changes) + | _ -> true) + |> Seq.map (fun (p,_) -> groupName,p) |> Set.ofSeq let modified groupName transitives = @@ -82,11 +59,11 @@ let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFil | Some pr -> let t = t.Value let t = { t with Settings = lockFile.GetGroup(groupName).Options.Settings + t.Settings } - yield groupName, name, getChanges groupName transitives pr t // Modified - | _ -> yield groupName, name, [PackageNotFoundInDependenciesFile] // Removed + if hasChanged groupName transitives pr t then + yield groupName, name // Modified + | _ -> yield groupName, name // Removed ] - |> List.filter (fun (_,_, changes) -> changes.Length > 0) - |> List.map (fun (g,p, changes) -> lockFile.GetAllNormalizedDependenciesOf(g,p,lockFile.FileName) |> Seq.map (fun (a,b) -> a,b,changes)) + |> List.map (fun (g,p) -> lockFile.GetAllNormalizedDependenciesOf(g,p,lockFile.FileName)) |> Seq.concat |> Set.ofSeq @@ -218,7 +195,7 @@ let GetChanges(dependenciesFile,lockFile,strict) = let nuGetChanges = findNuGetChangesInDependenciesFile(dependenciesFile,lockFile,strict) let nuGetChangesPerGroup = nuGetChanges - |> Seq.groupBy (fun (f,_,__) -> f) + |> Seq.groupBy fst |> Map.ofSeq let remoteFileChanges = findRemoteFileChangesInDependenciesFile(dependenciesFile,lockFile) diff --git a/src/Paket.Core/Files/LockFile.fs b/src/Paket.Core/Files/LockFile.fs index b80181b811..4f0d8f2815 100644 --- a/src/Paket.Core/Files/LockFile.fs +++ b/src/Paket.Core/Files/LockFile.fs @@ -274,7 +274,7 @@ module LockFileParser = | x -> failwithf "Unknown copy_content_to_output_dir settings: %A" x InstallOption(CopyContentToOutputDir(setting)) - | _, String.StartsWith "FRAMEWORK:" trimmed -> InstallOption(FrameworkRestrictions(FrameworkRestrictionList (trimmed.Trim() |> Requirements.parseRestrictions true))) + | _, String.StartsWith "FRAMEWORK:" trimmed -> InstallOption(FrameworkRestrictions(FrameworkRestrictionList (trimmed.Trim() |> Requirements.parseRestrictions))) | _, String.StartsWith "CONDITION:" trimmed -> InstallOption(ReferenceCondition(trimmed.Trim().ToUpper())) | _, String.StartsWith "CONTENT:" trimmed -> let setting = diff --git a/src/Paket.Core/Files/ReferencesFile.fs b/src/Paket.Core/Files/ReferencesFile.fs index 19abd51d95..e0c48d51cd 100644 --- a/src/Paket.Core/Files/ReferencesFile.fs +++ b/src/Paket.Core/Files/ReferencesFile.fs @@ -124,9 +124,7 @@ type ReferencesFile = static member FromFile(fileName : string) = let lines = File.ReadAllLines(fileName) - try - { ReferencesFile.FromLines lines with FileName = fileName } - with e -> raise <| new Exception(sprintf "Could not parse reference file '%s': %s" fileName e.Message, e) + { ReferencesFile.FromLines lines with FileName = fileName } member this.AddNuGetReference(groupName, packageName : PackageName, copyLocal: bool, importTargets: bool, frameworkRestrictions, includeVersionInPath, omitContent : bool, createBindingRedirects, referenceCondition) = let package: PackageInstallSettings = diff --git a/src/Paket.Core/FrameworkHandling.fs b/src/Paket.Core/FrameworkHandling.fs index a37a99eb25..d21f947731 100644 --- a/src/Paket.Core/FrameworkHandling.fs +++ b/src/Paket.Core/FrameworkHandling.fs @@ -129,7 +129,6 @@ module KnownAliases = ".netframework", "net" ".netcore", "netcore" "winrt", "netcore" - "netcoreapp", "netcore" "silverlight", "sl" "windowsphone", "wp" "windows", "win" @@ -350,8 +349,8 @@ module FrameworkDetection = | "sl5" | "sl50" -> Some (Silverlight "v5.0") | "win8" | "windows8" | "win80" | "netcore45" | "win" | "winv45" -> Some (Windows "v4.5") | "win81" | "windows81" | "netcore46" | "netcore451" | "winv451" -> Some (Windows "v4.5.1") - | "wp7" | "wp70" | "wpv7" | "wpv70" | "sl4-wp7"| "sl4-wp70" -> Some (WindowsPhoneSilverlight "v7.0") - | "wp71" | "wpv71" | "sl4-wp71" | "sl4-wp" -> Some (WindowsPhoneSilverlight "v7.1") + | "wp7" | "wp70" | "sl4-wp7"| "sl4-wp70" -> Some (WindowsPhoneSilverlight "v7.0") + | "wp71" | "sl4-wp71" | "sl4-wp" -> Some (WindowsPhoneSilverlight "v7.1") | "wpa00" | "wpa" | "wpa81" | "wpav81" | "wpapp81" | "wpapp" -> Some (WindowsPhoneApp "v8.1") | "wp8" | "wp80" | "wpv80" -> Some (WindowsPhoneSilverlight "v8.0") | "wp81" | "wpv81" -> Some (WindowsPhoneSilverlight "v8.1") @@ -365,8 +364,8 @@ module FrameworkDetection = | "netstandard14" -> Some(DotNetStandard DotNetStandardVersion.V1_4) | "netstandard15" -> Some(DotNetStandard DotNetStandardVersion.V1_5) | "netstandard16" -> Some(DotNetStandard DotNetStandardVersion.V1_6) - | "netcore10" -> Some (DotNetCore DotNetCoreVersion.V1_0) - | "netcore11" -> Some (DotNetCore DotNetCoreVersion.V1_1) + | "netcoreapp10" -> Some (DotNetCore DotNetCoreVersion.V1_0) + | "netcoreapp11" -> Some (DotNetCore DotNetCoreVersion.V1_1) | v when v.StartsWith "netstandard" -> Some(DotNetStandard DotNetStandardVersion.V1_6) | _ -> None result) diff --git a/src/Paket.Core/NuGetV3.fs b/src/Paket.Core/NuGetV3.fs index ae20914dc3..1db804321e 100644 --- a/src/Paket.Core/NuGetV3.fs +++ b/src/Paket.Core/NuGetV3.fs @@ -245,7 +245,7 @@ let getPackageDetails (source:NugetV3Source) (packageName:PackageName) (version: let targetFramework = match targetFramework with | null -> [] - | x -> Requirements.parseRestrictions false x + | x -> Requirements.parseRestrictions x (PackageName dep.Id), (VersionRequirement.Parse dep.Range), targetFramework) |> Seq.toList let unlisted = diff --git a/src/Paket.Core/NugetConvert.fs b/src/Paket.Core/NugetConvert.fs index 737c000c51..75175ffd89 100644 --- a/src/Paket.Core/NugetConvert.fs +++ b/src/Paket.Core/NugetConvert.fs @@ -259,7 +259,7 @@ let createDependenciesFileR (rootDirectory : DirectoryInfo) nugetEnv mode = let latestVersion, _ = versions |> List.maxBy fst let restrictions = match versions with - | [ version, targetFramework ] -> targetFramework |> Option.toList |> List.collect (Requirements.parseRestrictions false) + | [ version, targetFramework ] -> targetFramework |> Option.toList |> List.collect Requirements.parseRestrictions | _ -> [] name, latestVersion, restrictions) diff --git a/src/Paket.Core/PackageResolver.fs b/src/Paket.Core/PackageResolver.fs index 084ee2e4da..9c507f8d9a 100644 --- a/src/Paket.Core/PackageResolver.fs +++ b/src/Paket.Core/PackageResolver.fs @@ -651,7 +651,7 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate let rec step (stage:Stage) (stackpack:StackPack) compatibleVersions (flags:StepFlags) = - let inline fuseConflicts currentConflict priorConflictSteps = + let fuseConflicts currentConflict priorConflictSteps = match currentConflict, priorConflictSteps with | currentConflict, (lastConflict,lastStep,lastRequirement,lastCompatibleVersions,lastFlags)::priorConflictSteps -> let continueConflict = diff --git a/src/Paket.Core/Parsers/DependenciesFileParser.fs b/src/Paket.Core/Parsers/DependenciesFileParser.fs index b73954bf70..76c71549fb 100644 --- a/src/Paket.Core/Parsers/DependenciesFileParser.fs +++ b/src/Paket.Core/Parsers/DependenciesFileParser.fs @@ -301,7 +301,7 @@ module DependenciesFileParser = if text = "auto-detect" then Some (ParserOptions(ParserOption.AutodetectFrameworkRestrictions)) else - let restrictions = Requirements.parseRestrictions true text + let restrictions = Requirements.parseRestrictions text if String.IsNullOrWhiteSpace text |> not && List.isEmpty restrictions then failwithf "Could not parse framework restriction \"%s\"" text diff --git a/src/Paket.Core/Requirements.fs b/src/Paket.Core/Requirements.fs index 14cd85f21c..c12f2f88da 100644 --- a/src/Paket.Core/Requirements.fs +++ b/src/Paket.Core/Requirements.fs @@ -4,7 +4,6 @@ open System open Paket open Paket.Domain open Paket.PackageSources -open Paket.Logging [] type FrameworkRestriction = @@ -42,16 +41,7 @@ let getRestrictionList (frameworkRestrictions:FrameworkRestrictions) = | FrameworkRestrictionList list -> list | AutoDetectFramework -> failwith "The framework restriction could not be determined." -let parseRestrictions failImmediatly (text:string) = - let handleError = - if failImmediatly then - failwith - else - if verbose then - (fun s -> - traceError s - traceVerbose Environment.StackTrace) - else traceError +let parseRestrictions(text:string) = let text = // workaround missing spaces text.Replace("<=","<= ").Replace(">=",">= ").Replace("=","= ") @@ -70,17 +60,13 @@ let parseRestrictions failImmediatly (text:string) = | None -> if PlatformMatching.extractPlatforms framework |> List.isEmpty |> not then yield FrameworkRestriction.Portable framework - else - handleError <| sprintf "Could not parse framework '%s'. Try to update or install again or report a paket bug." framework | Some x -> if operatorSplit.[0] = ">=" then if operatorSplit.Length < 4 then yield FrameworkRestriction.AtLeast x else - let item = operatorSplit.[3] - match FrameworkDetection.Extract(item) with - | None -> - handleError <| sprintf "Could not parse second framework of between operator '%s'. Try to update or install again or report a paket bug." item + match FrameworkDetection.Extract(operatorSplit.[3]) with + | None -> () | Some y -> yield FrameworkRestriction.Between(x,y) else yield FrameworkRestriction.Exactly x] @@ -654,7 +640,7 @@ type InstallSettings = | _ -> None FrameworkRestrictions = match getPair "framework" with - | Some s -> FrameworkRestrictionList(parseRestrictions true s) + | Some s -> FrameworkRestrictionList(parseRestrictions s) | _ -> FrameworkRestrictionList [] OmitContent = match getPair "content" with diff --git a/src/Paket.Core/RestoreProcess.fs b/src/Paket.Core/RestoreProcess.fs index 7374c00181..4d6f6e31f8 100644 --- a/src/Paket.Core/RestoreProcess.fs +++ b/src/Paket.Core/RestoreProcess.fs @@ -193,13 +193,11 @@ let Restore(dependenciesFileName,projectFile,force,group,referencesFileNames,ign LocalFile.overrideLockFile localFile lockFile,localFile,true if not hasLocalFile && not ignoreChecks then - let hasAnyChanges,nugetChanges,remoteFilechanges,hasChanges = DependencyChangeDetection.GetChanges(dependenciesFile,lockFile,false) + let hasAnyChanges,_,_,_ = DependencyChangeDetection.GetChanges(dependenciesFile,lockFile,false) let checkResponse = if failOnChecks then failwithf else traceWarnfn if hasAnyChanges then checkResponse "paket.dependencies and paket.lock are out of sync in %s.%sPlease run 'paket install' or 'paket update' to recompute the paket.lock file." lockFileName.Directory.FullName Environment.NewLine - for (group, package, changes) in nugetChanges do - traceWarnfn "Changes %A were detected in %s/%s" changes (group.ToString()) (package.ToString()) let groups = match group with diff --git a/src/Paket.Core/UpdateProcess.fs b/src/Paket.Core/UpdateProcess.fs index 9d9ed09171..f4608fb198 100644 --- a/src/Paket.Core/UpdateProcess.fs +++ b/src/Paket.Core/UpdateProcess.fs @@ -109,7 +109,7 @@ let selectiveUpdate force getSha1 getSortedVersionsF getPackageDetailsF (lockFil dependenciesFile.Groups |> Map.filter hasChanges - nuGetChanges |> Set.map (fun (f,s,_) -> f,s), groups + nuGetChanges,groups let preferredVersions = DependencyChangeDetection.GetPreferredNuGetVersions(dependenciesFile,lockFile) diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index 48b5e807d5..810a954873 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -37,8 +37,8 @@ D:\temp\coreclrtest install C:\dev\src\Paket\integrationtests\scenarios\loading-scripts\dependencies-file-flag\temp - install - C:\PROJ\FAKE\ + install --createnewbindingfiles + D:\temp\pakkit2 pdbonly @@ -68,8 +68,8 @@ D:\temp\unlisted install D:\temp\PaketWithProblem1 - update - C:\PROJ\FAKE\ + restore + D:\temp\watchr2 11 diff --git a/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs b/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs index a0ad98eb34..8d5be5970a 100644 --- a/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs +++ b/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs @@ -61,7 +61,7 @@ nuget Castle.Windsor-log4net""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions(cfg,lockFile) newDependencies |> Map.filter (fun k v -> not <| changedDependencies.Contains(k)) @@ -98,7 +98,7 @@ nuget NUnit""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions (cfg,lockFile) let expected = @@ -146,7 +146,7 @@ nuget Castle.Windsor-log4net >= 3.3.0""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions (cfg,lockFile) let expected = @@ -193,7 +193,7 @@ nuget Castle.Windsor-log4net >= 3.4.0""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions (cfg,lockFile) newDependencies @@ -297,7 +297,7 @@ nuget Caliburn.Micro !~> 2.0.2""" let lockFile = LockFile.Parse("",toLines lockFileData) let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) changedDependencies.Count |> shouldEqual 1 - (changedDependencies |> Seq.head) |> shouldEqual (Constants.MainDependencyGroup, PackageName "Caliburn.Micro",[Paket.DependencyChangeDetection.DependencyChangeType.PackageNotFoundInLockFile]) + (changedDependencies |> Seq.head) |> shouldEqual (Constants.MainDependencyGroup, PackageName "Caliburn.Micro") [] let ``should detect if nothing changes in github dependency``() = From cddcd49f253d91124a2f9ff431dcbd49778079b0 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 9 Apr 2017 18:55:15 +0200 Subject: [PATCH 22/45] RELEASE_NOTES --- RELEASE_NOTES.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 242b4e7a9c..88d6455ba5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,7 +1,4 @@ -#### 4.1.8 - 09.04.2017 -* BUGFIX: Improved output of the outdated warning and fix underlying bug - https://github.com/fsprojects/Paket/pull/2223 - -#### 4.1.7 - 06.04.2017 +#### 4.1.9 - 06.04.2017 * BUGFIX: Make Paket.Restore.targets be called in more situations #### 4.1.6 - 02.04.2017 From c5d876b1e9ade5f896de5a8ff243510021278393 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 9 Apr 2017 19:00:23 +0200 Subject: [PATCH 23/45] Bump version to 4.1.9 --- src/Paket.Bootstrapper/Properties/AssemblyInfo.cs | 12 ++++++------ src/Paket.Core/AssemblyInfo.fs | 12 ++++++------ src/Paket.PowerShell/AssemblyInfo.fs | 12 ++++++------ src/Paket/AssemblyInfo.fs | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs index e3ebf9e8f8..2d0e91fd8b 100644 --- a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs +++ b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs @@ -4,16 +4,16 @@ [assembly: AssemblyTitleAttribute("Paket.Bootstrapper")] [assembly: AssemblyProductAttribute("Paket")] [assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")] -[assembly: AssemblyVersionAttribute("4.1.8")] -[assembly: AssemblyFileVersionAttribute("4.1.8")] -[assembly: AssemblyInformationalVersionAttribute("4.1.8")] +[assembly: AssemblyVersionAttribute("4.1.9")] +[assembly: AssemblyFileVersionAttribute("4.1.9")] +[assembly: AssemblyInformationalVersionAttribute("4.1.9")] namespace System { internal static class AssemblyVersionInformation { internal const System.String AssemblyTitle = "Paket.Bootstrapper"; internal const System.String AssemblyProduct = "Paket"; internal const System.String AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories."; - internal const System.String AssemblyVersion = "4.1.8"; - internal const System.String AssemblyFileVersion = "4.1.8"; - internal const System.String AssemblyInformationalVersion = "4.1.8"; + internal const System.String AssemblyVersion = "4.1.9"; + internal const System.String AssemblyFileVersion = "4.1.9"; + internal const System.String AssemblyInformationalVersion = "4.1.9"; } } diff --git a/src/Paket.Core/AssemblyInfo.fs b/src/Paket.Core/AssemblyInfo.fs index a87c3f7c1e..a998006a29 100644 --- a/src/Paket.Core/AssemblyInfo.fs +++ b/src/Paket.Core/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.8" - let [] AssemblyFileVersion = "4.1.8" - let [] AssemblyInformationalVersion = "4.1.8" + let [] AssemblyVersion = "4.1.9" + let [] AssemblyFileVersion = "4.1.9" + let [] AssemblyInformationalVersion = "4.1.9" diff --git a/src/Paket.PowerShell/AssemblyInfo.fs b/src/Paket.PowerShell/AssemblyInfo.fs index 3c69466294..629c23a745 100644 --- a/src/Paket.PowerShell/AssemblyInfo.fs +++ b/src/Paket.PowerShell/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.8" - let [] AssemblyFileVersion = "4.1.8" - let [] AssemblyInformationalVersion = "4.1.8" + let [] AssemblyVersion = "4.1.9" + let [] AssemblyFileVersion = "4.1.9" + let [] AssemblyInformationalVersion = "4.1.9" diff --git a/src/Paket/AssemblyInfo.fs b/src/Paket/AssemblyInfo.fs index bf82109367..ffcb272013 100644 --- a/src/Paket/AssemblyInfo.fs +++ b/src/Paket/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.8" - let [] AssemblyFileVersion = "4.1.8" - let [] AssemblyInformationalVersion = "4.1.8" + let [] AssemblyVersion = "4.1.9" + let [] AssemblyFileVersion = "4.1.9" + let [] AssemblyInformationalVersion = "4.1.9" From e594e893543bb7a3ca811cb86a2730a3691608ec Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 9 Apr 2017 19:01:14 +0200 Subject: [PATCH 24/45] Revert "Revert "Merge branch 'fix_annoying_warning_2222' of https://github.com/matthid/Paket"" This reverts commit 4edb04dbb8d506f922ebf604510b317b94c22019. --- RELEASE_NOTES.md | 9 +-- src/Paket.Core/DependencyChangeDetection.fs | 63 +++++++++++++------ src/Paket.Core/Files/LockFile.fs | 2 +- src/Paket.Core/Files/ReferencesFile.fs | 4 +- src/Paket.Core/FrameworkHandling.fs | 9 +-- src/Paket.Core/NuGetV3.fs | 2 +- src/Paket.Core/NugetConvert.fs | 2 +- src/Paket.Core/PackageResolver.fs | 2 +- .../Parsers/DependenciesFileParser.fs | 2 +- src/Paket.Core/Requirements.fs | 22 +++++-- src/Paket.Core/RestoreProcess.fs | 4 +- src/Paket.Core/UpdateProcess.fs | 2 +- src/Paket/Paket.fsproj | 8 +-- .../DependencyChangesSpecs.fs | 10 +-- 14 files changed, 89 insertions(+), 52 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 88d6455ba5..d668697934 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,13 +1,8 @@ -#### 4.1.9 - 06.04.2017 +#### 4.2.0 - 09.04.2017 +* BUGFIX: Improved output of the outdated warning and fix underlying bug - https://github.com/fsprojects/Paket/pull/2223 * BUGFIX: Make Paket.Restore.targets be called in more situations - -#### 4.1.6 - 02.04.2017 * BUGFIX: Fix to handle weird malformed portable-only libraries - https://github.com/fsprojects/Paket/pull/2215 - -#### 4.1.5 - 02.04.2017 * BUGFIX: Detect changes in redirects settings - -#### 4.1.4 - 31.03.2017 * BUGFIX: Workaround for TFS dependency resolution - https://github.com/fsprojects/Paket/pull/2214 #### 4.1.3 - 30.03.2017 diff --git a/src/Paket.Core/DependencyChangeDetection.fs b/src/Paket.Core/DependencyChangeDetection.fs index 7d20c40356..3d99e9e39b 100644 --- a/src/Paket.Core/DependencyChangeDetection.fs +++ b/src/Paket.Core/DependencyChangeDetection.fs @@ -3,25 +3,46 @@ open Paket.Requirements open Paket.PackageResolver +type DependencyChangeType = + /// The restrictions changed + | RestrictionsChanged + /// The settigns of the package changed + | SettingsChanged + /// The Version in the LockFile doesn't match the spec in the dependencies file. + | VersionNotValid + /// Package from dependencies file was not found in lockfile + | PackageNotFoundInLockFile + /// Group from dependencies file was not found in lockfile + | GroupNotFoundInLockFile + /// Package from lock file was not found in dependencies file + | PackageNotFoundInDependenciesFile + let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFile:LockFile,strict) = let allTransitives groupName = lockFile.GetTransitiveDependencies groupName - let hasChanged groupName transitives (newRequirement:PackageRequirement) (originalPackage:ResolvedPackage) = + let getChanges groupName transitives (newRequirement:PackageRequirement) (originalPackage:ResolvedPackage) = let settingsChanged() = if newRequirement.Settings <> originalPackage.Settings then if newRequirement.Settings = { originalPackage.Settings with FrameworkRestrictions = AutoDetectFramework } then - false + [] elif newRequirement.Settings.FrameworkRestrictions <> originalPackage.Settings.FrameworkRestrictions then - transitives |> Seq.contains originalPackage.Name |> not - else true - else false + let isTransitive = transitives |> Seq.contains originalPackage.Name + if not isTransitive then + [RestrictionsChanged] + else [] + else [SettingsChanged] + else [] let requirementOk = - if strict then - newRequirement.VersionRequirement.IsInRange originalPackage.Version - else - newRequirement.IncludingPrereleases().VersionRequirement.IsInRange originalPackage.Version + let isInRange = + if strict then + newRequirement.VersionRequirement.IsInRange originalPackage.Version + else + newRequirement.IncludingPrereleases().VersionRequirement.IsInRange originalPackage.Version + if not isInRange then + [VersionNotValid] + else [] - (not requirementOk) || settingsChanged() + requirementOk @ settingsChanged() let added groupName transitives = match dependenciesFile.Groups |> Map.tryFind groupName with @@ -31,17 +52,19 @@ let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFil depsGroup.Packages |> Seq.map (fun d -> d.Name, { d with Settings = depsGroup.Options.Settings + d.Settings }) - |> Seq.filter (fun (name,dependenciesFilePackage) -> + |> Seq.map (fun (name,dependenciesFilePackage) -> + name, dependenciesFilePackage, match lockFileGroup with - | None -> true + | None -> [GroupNotFoundInLockFile] | Some group -> match group.Resolution.TryFind name with | Some lockFilePackage -> - hasChanged groupName transitives + getChanges groupName transitives { dependenciesFilePackage with Settings = depsGroup.Options.Settings + dependenciesFilePackage.Settings } { lockFilePackage with Settings = group.Options.Settings + lockFilePackage.Settings } - | _ -> true) - |> Seq.map (fun (p,_) -> groupName,p) + | _ -> [PackageNotFoundInLockFile]) + |> Seq.filter (fun (_,_, changes) -> changes.Length > 0) + |> Seq.map (fun (p,_, changes) -> groupName, p, changes) |> Set.ofSeq let modified groupName transitives = @@ -59,11 +82,11 @@ let findNuGetChangesInDependenciesFile(dependenciesFile:DependenciesFile,lockFil | Some pr -> let t = t.Value let t = { t with Settings = lockFile.GetGroup(groupName).Options.Settings + t.Settings } - if hasChanged groupName transitives pr t then - yield groupName, name // Modified - | _ -> yield groupName, name // Removed + yield groupName, name, getChanges groupName transitives pr t // Modified + | _ -> yield groupName, name, [PackageNotFoundInDependenciesFile] // Removed ] - |> List.map (fun (g,p) -> lockFile.GetAllNormalizedDependenciesOf(g,p,lockFile.FileName)) + |> List.filter (fun (_,_, changes) -> changes.Length > 0) + |> List.map (fun (g,p, changes) -> lockFile.GetAllNormalizedDependenciesOf(g,p,lockFile.FileName) |> Seq.map (fun (a,b) -> a,b,changes)) |> Seq.concat |> Set.ofSeq @@ -195,7 +218,7 @@ let GetChanges(dependenciesFile,lockFile,strict) = let nuGetChanges = findNuGetChangesInDependenciesFile(dependenciesFile,lockFile,strict) let nuGetChangesPerGroup = nuGetChanges - |> Seq.groupBy fst + |> Seq.groupBy (fun (f,_,__) -> f) |> Map.ofSeq let remoteFileChanges = findRemoteFileChangesInDependenciesFile(dependenciesFile,lockFile) diff --git a/src/Paket.Core/Files/LockFile.fs b/src/Paket.Core/Files/LockFile.fs index 4f0d8f2815..b80181b811 100644 --- a/src/Paket.Core/Files/LockFile.fs +++ b/src/Paket.Core/Files/LockFile.fs @@ -274,7 +274,7 @@ module LockFileParser = | x -> failwithf "Unknown copy_content_to_output_dir settings: %A" x InstallOption(CopyContentToOutputDir(setting)) - | _, String.StartsWith "FRAMEWORK:" trimmed -> InstallOption(FrameworkRestrictions(FrameworkRestrictionList (trimmed.Trim() |> Requirements.parseRestrictions))) + | _, String.StartsWith "FRAMEWORK:" trimmed -> InstallOption(FrameworkRestrictions(FrameworkRestrictionList (trimmed.Trim() |> Requirements.parseRestrictions true))) | _, String.StartsWith "CONDITION:" trimmed -> InstallOption(ReferenceCondition(trimmed.Trim().ToUpper())) | _, String.StartsWith "CONTENT:" trimmed -> let setting = diff --git a/src/Paket.Core/Files/ReferencesFile.fs b/src/Paket.Core/Files/ReferencesFile.fs index e0c48d51cd..19abd51d95 100644 --- a/src/Paket.Core/Files/ReferencesFile.fs +++ b/src/Paket.Core/Files/ReferencesFile.fs @@ -124,7 +124,9 @@ type ReferencesFile = static member FromFile(fileName : string) = let lines = File.ReadAllLines(fileName) - { ReferencesFile.FromLines lines with FileName = fileName } + try + { ReferencesFile.FromLines lines with FileName = fileName } + with e -> raise <| new Exception(sprintf "Could not parse reference file '%s': %s" fileName e.Message, e) member this.AddNuGetReference(groupName, packageName : PackageName, copyLocal: bool, importTargets: bool, frameworkRestrictions, includeVersionInPath, omitContent : bool, createBindingRedirects, referenceCondition) = let package: PackageInstallSettings = diff --git a/src/Paket.Core/FrameworkHandling.fs b/src/Paket.Core/FrameworkHandling.fs index d21f947731..a37a99eb25 100644 --- a/src/Paket.Core/FrameworkHandling.fs +++ b/src/Paket.Core/FrameworkHandling.fs @@ -129,6 +129,7 @@ module KnownAliases = ".netframework", "net" ".netcore", "netcore" "winrt", "netcore" + "netcoreapp", "netcore" "silverlight", "sl" "windowsphone", "wp" "windows", "win" @@ -349,8 +350,8 @@ module FrameworkDetection = | "sl5" | "sl50" -> Some (Silverlight "v5.0") | "win8" | "windows8" | "win80" | "netcore45" | "win" | "winv45" -> Some (Windows "v4.5") | "win81" | "windows81" | "netcore46" | "netcore451" | "winv451" -> Some (Windows "v4.5.1") - | "wp7" | "wp70" | "sl4-wp7"| "sl4-wp70" -> Some (WindowsPhoneSilverlight "v7.0") - | "wp71" | "sl4-wp71" | "sl4-wp" -> Some (WindowsPhoneSilverlight "v7.1") + | "wp7" | "wp70" | "wpv7" | "wpv70" | "sl4-wp7"| "sl4-wp70" -> Some (WindowsPhoneSilverlight "v7.0") + | "wp71" | "wpv71" | "sl4-wp71" | "sl4-wp" -> Some (WindowsPhoneSilverlight "v7.1") | "wpa00" | "wpa" | "wpa81" | "wpav81" | "wpapp81" | "wpapp" -> Some (WindowsPhoneApp "v8.1") | "wp8" | "wp80" | "wpv80" -> Some (WindowsPhoneSilverlight "v8.0") | "wp81" | "wpv81" -> Some (WindowsPhoneSilverlight "v8.1") @@ -364,8 +365,8 @@ module FrameworkDetection = | "netstandard14" -> Some(DotNetStandard DotNetStandardVersion.V1_4) | "netstandard15" -> Some(DotNetStandard DotNetStandardVersion.V1_5) | "netstandard16" -> Some(DotNetStandard DotNetStandardVersion.V1_6) - | "netcoreapp10" -> Some (DotNetCore DotNetCoreVersion.V1_0) - | "netcoreapp11" -> Some (DotNetCore DotNetCoreVersion.V1_1) + | "netcore10" -> Some (DotNetCore DotNetCoreVersion.V1_0) + | "netcore11" -> Some (DotNetCore DotNetCoreVersion.V1_1) | v when v.StartsWith "netstandard" -> Some(DotNetStandard DotNetStandardVersion.V1_6) | _ -> None result) diff --git a/src/Paket.Core/NuGetV3.fs b/src/Paket.Core/NuGetV3.fs index 1db804321e..ae20914dc3 100644 --- a/src/Paket.Core/NuGetV3.fs +++ b/src/Paket.Core/NuGetV3.fs @@ -245,7 +245,7 @@ let getPackageDetails (source:NugetV3Source) (packageName:PackageName) (version: let targetFramework = match targetFramework with | null -> [] - | x -> Requirements.parseRestrictions x + | x -> Requirements.parseRestrictions false x (PackageName dep.Id), (VersionRequirement.Parse dep.Range), targetFramework) |> Seq.toList let unlisted = diff --git a/src/Paket.Core/NugetConvert.fs b/src/Paket.Core/NugetConvert.fs index 75175ffd89..737c000c51 100644 --- a/src/Paket.Core/NugetConvert.fs +++ b/src/Paket.Core/NugetConvert.fs @@ -259,7 +259,7 @@ let createDependenciesFileR (rootDirectory : DirectoryInfo) nugetEnv mode = let latestVersion, _ = versions |> List.maxBy fst let restrictions = match versions with - | [ version, targetFramework ] -> targetFramework |> Option.toList |> List.collect Requirements.parseRestrictions + | [ version, targetFramework ] -> targetFramework |> Option.toList |> List.collect (Requirements.parseRestrictions false) | _ -> [] name, latestVersion, restrictions) diff --git a/src/Paket.Core/PackageResolver.fs b/src/Paket.Core/PackageResolver.fs index 9c507f8d9a..084ee2e4da 100644 --- a/src/Paket.Core/PackageResolver.fs +++ b/src/Paket.Core/PackageResolver.fs @@ -651,7 +651,7 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate let rec step (stage:Stage) (stackpack:StackPack) compatibleVersions (flags:StepFlags) = - let fuseConflicts currentConflict priorConflictSteps = + let inline fuseConflicts currentConflict priorConflictSteps = match currentConflict, priorConflictSteps with | currentConflict, (lastConflict,lastStep,lastRequirement,lastCompatibleVersions,lastFlags)::priorConflictSteps -> let continueConflict = diff --git a/src/Paket.Core/Parsers/DependenciesFileParser.fs b/src/Paket.Core/Parsers/DependenciesFileParser.fs index 76c71549fb..b73954bf70 100644 --- a/src/Paket.Core/Parsers/DependenciesFileParser.fs +++ b/src/Paket.Core/Parsers/DependenciesFileParser.fs @@ -301,7 +301,7 @@ module DependenciesFileParser = if text = "auto-detect" then Some (ParserOptions(ParserOption.AutodetectFrameworkRestrictions)) else - let restrictions = Requirements.parseRestrictions text + let restrictions = Requirements.parseRestrictions true text if String.IsNullOrWhiteSpace text |> not && List.isEmpty restrictions then failwithf "Could not parse framework restriction \"%s\"" text diff --git a/src/Paket.Core/Requirements.fs b/src/Paket.Core/Requirements.fs index c12f2f88da..14cd85f21c 100644 --- a/src/Paket.Core/Requirements.fs +++ b/src/Paket.Core/Requirements.fs @@ -4,6 +4,7 @@ open System open Paket open Paket.Domain open Paket.PackageSources +open Paket.Logging [] type FrameworkRestriction = @@ -41,7 +42,16 @@ let getRestrictionList (frameworkRestrictions:FrameworkRestrictions) = | FrameworkRestrictionList list -> list | AutoDetectFramework -> failwith "The framework restriction could not be determined." -let parseRestrictions(text:string) = +let parseRestrictions failImmediatly (text:string) = + let handleError = + if failImmediatly then + failwith + else + if verbose then + (fun s -> + traceError s + traceVerbose Environment.StackTrace) + else traceError let text = // workaround missing spaces text.Replace("<=","<= ").Replace(">=",">= ").Replace("=","= ") @@ -60,13 +70,17 @@ let parseRestrictions(text:string) = | None -> if PlatformMatching.extractPlatforms framework |> List.isEmpty |> not then yield FrameworkRestriction.Portable framework + else + handleError <| sprintf "Could not parse framework '%s'. Try to update or install again or report a paket bug." framework | Some x -> if operatorSplit.[0] = ">=" then if operatorSplit.Length < 4 then yield FrameworkRestriction.AtLeast x else - match FrameworkDetection.Extract(operatorSplit.[3]) with - | None -> () + let item = operatorSplit.[3] + match FrameworkDetection.Extract(item) with + | None -> + handleError <| sprintf "Could not parse second framework of between operator '%s'. Try to update or install again or report a paket bug." item | Some y -> yield FrameworkRestriction.Between(x,y) else yield FrameworkRestriction.Exactly x] @@ -640,7 +654,7 @@ type InstallSettings = | _ -> None FrameworkRestrictions = match getPair "framework" with - | Some s -> FrameworkRestrictionList(parseRestrictions s) + | Some s -> FrameworkRestrictionList(parseRestrictions true s) | _ -> FrameworkRestrictionList [] OmitContent = match getPair "content" with diff --git a/src/Paket.Core/RestoreProcess.fs b/src/Paket.Core/RestoreProcess.fs index 4d6f6e31f8..7374c00181 100644 --- a/src/Paket.Core/RestoreProcess.fs +++ b/src/Paket.Core/RestoreProcess.fs @@ -193,11 +193,13 @@ let Restore(dependenciesFileName,projectFile,force,group,referencesFileNames,ign LocalFile.overrideLockFile localFile lockFile,localFile,true if not hasLocalFile && not ignoreChecks then - let hasAnyChanges,_,_,_ = DependencyChangeDetection.GetChanges(dependenciesFile,lockFile,false) + let hasAnyChanges,nugetChanges,remoteFilechanges,hasChanges = DependencyChangeDetection.GetChanges(dependenciesFile,lockFile,false) let checkResponse = if failOnChecks then failwithf else traceWarnfn if hasAnyChanges then checkResponse "paket.dependencies and paket.lock are out of sync in %s.%sPlease run 'paket install' or 'paket update' to recompute the paket.lock file." lockFileName.Directory.FullName Environment.NewLine + for (group, package, changes) in nugetChanges do + traceWarnfn "Changes %A were detected in %s/%s" changes (group.ToString()) (package.ToString()) let groups = match group with diff --git a/src/Paket.Core/UpdateProcess.fs b/src/Paket.Core/UpdateProcess.fs index f4608fb198..9d9ed09171 100644 --- a/src/Paket.Core/UpdateProcess.fs +++ b/src/Paket.Core/UpdateProcess.fs @@ -109,7 +109,7 @@ let selectiveUpdate force getSha1 getSortedVersionsF getPackageDetailsF (lockFil dependenciesFile.Groups |> Map.filter hasChanges - nuGetChanges,groups + nuGetChanges |> Set.map (fun (f,s,_) -> f,s), groups let preferredVersions = DependencyChangeDetection.GetPreferredNuGetVersions(dependenciesFile,lockFile) diff --git a/src/Paket/Paket.fsproj b/src/Paket/Paket.fsproj index 810a954873..48b5e807d5 100644 --- a/src/Paket/Paket.fsproj +++ b/src/Paket/Paket.fsproj @@ -37,8 +37,8 @@ D:\temp\coreclrtest install C:\dev\src\Paket\integrationtests\scenarios\loading-scripts\dependencies-file-flag\temp - install --createnewbindingfiles - D:\temp\pakkit2 + install + C:\PROJ\FAKE\ pdbonly @@ -68,8 +68,8 @@ D:\temp\unlisted install D:\temp\PaketWithProblem1 - restore - D:\temp\watchr2 + update + C:\PROJ\FAKE\ 11 diff --git a/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs b/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs index 8d5be5970a..a0ad98eb34 100644 --- a/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs +++ b/tests/Paket.Tests/DependenciesFile/DependencyChangesSpecs.fs @@ -61,7 +61,7 @@ nuget Castle.Windsor-log4net""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions(cfg,lockFile) newDependencies |> Map.filter (fun k v -> not <| changedDependencies.Contains(k)) @@ -98,7 +98,7 @@ nuget NUnit""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions (cfg,lockFile) let expected = @@ -146,7 +146,7 @@ nuget Castle.Windsor-log4net >= 3.3.0""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions (cfg,lockFile) let expected = @@ -193,7 +193,7 @@ nuget Castle.Windsor-log4net >= 3.4.0""" let cfg = DependenciesFile.FromCode(after) let lockFile = LockFile.Parse("",toLines lockFileData) - let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) + let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) |> Set.map (fun (g,p,_) -> g, p) let newDependencies = DependencyChangeDetection.GetPreferredNuGetVersions (cfg,lockFile) newDependencies @@ -297,7 +297,7 @@ nuget Caliburn.Micro !~> 2.0.2""" let lockFile = LockFile.Parse("",toLines lockFileData) let changedDependencies = DependencyChangeDetection.findNuGetChangesInDependenciesFile(cfg,lockFile,true) changedDependencies.Count |> shouldEqual 1 - (changedDependencies |> Seq.head) |> shouldEqual (Constants.MainDependencyGroup, PackageName "Caliburn.Micro") + (changedDependencies |> Seq.head) |> shouldEqual (Constants.MainDependencyGroup, PackageName "Caliburn.Micro",[Paket.DependencyChangeDetection.DependencyChangeType.PackageNotFoundInLockFile]) [] let ``should detect if nothing changes in github dependency``() = From f82aaf092440016dedc480d6806307f804f87ea3 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 9 Apr 2017 19:06:33 +0200 Subject: [PATCH 25/45] Bump version to 4.2.0 --- src/Paket.Bootstrapper/Properties/AssemblyInfo.cs | 12 ++++++------ src/Paket.Core/AssemblyInfo.fs | 12 ++++++------ src/Paket.PowerShell/AssemblyInfo.fs | 12 ++++++------ src/Paket/AssemblyInfo.fs | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs index 2d0e91fd8b..988414bdaf 100644 --- a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs +++ b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs @@ -4,16 +4,16 @@ [assembly: AssemblyTitleAttribute("Paket.Bootstrapper")] [assembly: AssemblyProductAttribute("Paket")] [assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")] -[assembly: AssemblyVersionAttribute("4.1.9")] -[assembly: AssemblyFileVersionAttribute("4.1.9")] -[assembly: AssemblyInformationalVersionAttribute("4.1.9")] +[assembly: AssemblyVersionAttribute("4.2.0")] +[assembly: AssemblyFileVersionAttribute("4.2.0")] +[assembly: AssemblyInformationalVersionAttribute("4.2.0")] namespace System { internal static class AssemblyVersionInformation { internal const System.String AssemblyTitle = "Paket.Bootstrapper"; internal const System.String AssemblyProduct = "Paket"; internal const System.String AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories."; - internal const System.String AssemblyVersion = "4.1.9"; - internal const System.String AssemblyFileVersion = "4.1.9"; - internal const System.String AssemblyInformationalVersion = "4.1.9"; + internal const System.String AssemblyVersion = "4.2.0"; + internal const System.String AssemblyFileVersion = "4.2.0"; + internal const System.String AssemblyInformationalVersion = "4.2.0"; } } diff --git a/src/Paket.Core/AssemblyInfo.fs b/src/Paket.Core/AssemblyInfo.fs index a998006a29..0622521986 100644 --- a/src/Paket.Core/AssemblyInfo.fs +++ b/src/Paket.Core/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.9" - let [] AssemblyFileVersion = "4.1.9" - let [] AssemblyInformationalVersion = "4.1.9" + let [] AssemblyVersion = "4.2.0" + let [] AssemblyFileVersion = "4.2.0" + let [] AssemblyInformationalVersion = "4.2.0" diff --git a/src/Paket.PowerShell/AssemblyInfo.fs b/src/Paket.PowerShell/AssemblyInfo.fs index 629c23a745..8a61bd455d 100644 --- a/src/Paket.PowerShell/AssemblyInfo.fs +++ b/src/Paket.PowerShell/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.9" - let [] AssemblyFileVersion = "4.1.9" - let [] AssemblyInformationalVersion = "4.1.9" + let [] AssemblyVersion = "4.2.0" + let [] AssemblyFileVersion = "4.2.0" + let [] AssemblyInformationalVersion = "4.2.0" diff --git a/src/Paket/AssemblyInfo.fs b/src/Paket/AssemblyInfo.fs index ffcb272013..fd33da5d6c 100644 --- a/src/Paket/AssemblyInfo.fs +++ b/src/Paket/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.1.9" - let [] AssemblyFileVersion = "4.1.9" - let [] AssemblyInformationalVersion = "4.1.9" + let [] AssemblyVersion = "4.2.0" + let [] AssemblyFileVersion = "4.2.0" + let [] AssemblyInformationalVersion = "4.2.0" From 62edc5a179173d077e6ff053aba58bcf222af45f Mon Sep 17 00:00:00 2001 From: bchavez Date: Thu, 6 Apr 2017 20:26:19 -0700 Subject: [PATCH 26/45] check if references file exists on disk before allowing paket to install --- .../before/AutoRestoreTwice/paket.references | 0 src/Paket.Core/RestoreProcess.fs | 10 +++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 integrationtests/scenarios/i001835-auto-restore-on-twice/before/AutoRestoreTwice/paket.references diff --git a/integrationtests/scenarios/i001835-auto-restore-on-twice/before/AutoRestoreTwice/paket.references b/integrationtests/scenarios/i001835-auto-restore-on-twice/before/AutoRestoreTwice/paket.references new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/Paket.Core/RestoreProcess.fs b/src/Paket.Core/RestoreProcess.fs index 7374c00181..1e53bb235e 100644 --- a/src/Paket.Core/RestoreProcess.fs +++ b/src/Paket.Core/RestoreProcess.fs @@ -134,9 +134,17 @@ let findAllReferencesFiles root = Path.Combine(fi.Directory.FullName,Constants.ReferencesFile) ok <| (p, ReferencesFile.New fileName) + + let refFileExistsOnDisk (result:Result<(ProjectFile * ReferencesFile), DomainMessage>) = + result + |> + either + (fun ((_, referenceFile), _) -> File.Exists(referenceFile.FileName)) + (fun (_) -> true) - ProjectFile.FindAllProjects root + ProjectFile.FindAllProjects root |> Array.map findRefFile + |> Array.filter( fun result -> refFileExistsOnDisk result ) |> collect let copiedElements = ref false From 374e32133461383c6546cdbba7a2b83a811f49d1 Mon Sep 17 00:00:00 2001 From: bchavez Date: Sun, 9 Apr 2017 15:47:07 -0700 Subject: [PATCH 27/45] Fixed failing tests --- .../Paket.IntegrationTests/LoadingScriptGenerationTests.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs b/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs index 926d95bc9c..77e7770022 100644 --- a/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs +++ b/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs @@ -210,7 +210,7 @@ let ``generates script on install`` () = [] let ``issue 2156 netstandard`` () = - let scenario = "issue-2156" + let scenario = "issue-2156-netstandard" paket "install" scenario |> ignore directPaket "generate-load-scripts" scenario |> ignore // note: no assert for now, I don't know what we are exactly expecting \ No newline at end of file From 5572b0570d1d25ee702477e2c086a76130acd395 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Mon, 10 Apr 2017 08:47:09 +0200 Subject: [PATCH 28/45] fix testname --- RELEASE_NOTES.md | 3 +++ .../Paket.IntegrationTests/LoadingScriptGenerationTests.fs | 2 +- .../before/paket.dependencies | 0 3 files changed, 4 insertions(+), 1 deletion(-) rename integrationtests/scenarios/loading-scripts/{issue-2156-netstandard => issue-2156}/before/paket.dependencies (100%) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d668697934..9bda02795d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 4.2.1 - 10.04.2017 +* BUGFIX: Check if a references file exists on disk - https://github.com/fsprojects/Paket/pull/2224 + #### 4.2.0 - 09.04.2017 * BUGFIX: Improved output of the outdated warning and fix underlying bug - https://github.com/fsprojects/Paket/pull/2223 * BUGFIX: Make Paket.Restore.targets be called in more situations diff --git a/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs b/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs index 77e7770022..926d95bc9c 100644 --- a/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs +++ b/integrationtests/Paket.IntegrationTests/LoadingScriptGenerationTests.fs @@ -210,7 +210,7 @@ let ``generates script on install`` () = [] let ``issue 2156 netstandard`` () = - let scenario = "issue-2156-netstandard" + let scenario = "issue-2156" paket "install" scenario |> ignore directPaket "generate-load-scripts" scenario |> ignore // note: no assert for now, I don't know what we are exactly expecting \ No newline at end of file diff --git a/integrationtests/scenarios/loading-scripts/issue-2156-netstandard/before/paket.dependencies b/integrationtests/scenarios/loading-scripts/issue-2156/before/paket.dependencies similarity index 100% rename from integrationtests/scenarios/loading-scripts/issue-2156-netstandard/before/paket.dependencies rename to integrationtests/scenarios/loading-scripts/issue-2156/before/paket.dependencies From c9eaf484cfeba314517faf1ad362c2e467f53ee5 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Mon, 10 Apr 2017 08:52:46 +0200 Subject: [PATCH 29/45] cleanup --- src/Paket.Core/RestoreProcess.fs | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/Paket.Core/RestoreProcess.fs b/src/Paket.Core/RestoreProcess.fs index 1e53bb235e..0d749065df 100644 --- a/src/Paket.Core/RestoreProcess.fs +++ b/src/Paket.Core/RestoreProcess.fs @@ -124,27 +124,15 @@ let findAllReferencesFiles root = let findRefFile (p:ProjectFile) = match p.FindReferencesFile() with | Some fileName -> - try - ok <| (p, ReferencesFile.FromFile fileName) - with _ -> - fail <| ReferencesFileParseError (FileInfo fileName) + try + Some(ok <| (p, ReferencesFile.FromFile fileName)) + with _ -> + Some(fail <| (ReferencesFileParseError (FileInfo fileName))) | None -> - let fileName = - let fi = FileInfo(p.FileName) - Path.Combine(fi.Directory.FullName,Constants.ReferencesFile) - - ok <| (p, ReferencesFile.New fileName) - - let refFileExistsOnDisk (result:Result<(ProjectFile * ReferencesFile), DomainMessage>) = - result - |> - either - (fun ((_, referenceFile), _) -> File.Exists(referenceFile.FileName)) - (fun (_) -> true) - + None + ProjectFile.FindAllProjects root - |> Array.map findRefFile - |> Array.filter( fun result -> refFileExistsOnDisk result ) + |> Array.choose findRefFile |> collect let copiedElements = ref false From e53f6bbc7ba0435d42c18e17e20cd60d6a8c1546 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Mon, 10 Apr 2017 09:05:27 +0200 Subject: [PATCH 30/45] RELEASE_NOTES --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 9bda02795d..582f41f90d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,4 +1,4 @@ -#### 4.2.1 - 10.04.2017 +#### 4.3.0 - 10.04.2017 * BUGFIX: Check if a references file exists on disk - https://github.com/fsprojects/Paket/pull/2224 #### 4.2.0 - 09.04.2017 From e2b572836ef4c56a7493b08ade5c4f854bd900ac Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Mon, 10 Apr 2017 09:10:04 +0200 Subject: [PATCH 31/45] Bump version to 4.3.0 --- src/Paket.Bootstrapper/Properties/AssemblyInfo.cs | 12 ++++++------ src/Paket.Core/AssemblyInfo.fs | 12 ++++++------ src/Paket.PowerShell/AssemblyInfo.fs | 12 ++++++------ src/Paket/AssemblyInfo.fs | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs index 988414bdaf..d2395325c4 100644 --- a/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs +++ b/src/Paket.Bootstrapper/Properties/AssemblyInfo.cs @@ -4,16 +4,16 @@ [assembly: AssemblyTitleAttribute("Paket.Bootstrapper")] [assembly: AssemblyProductAttribute("Paket")] [assembly: AssemblyDescriptionAttribute("A dependency manager for .NET with support for NuGet packages and git repositories.")] -[assembly: AssemblyVersionAttribute("4.2.0")] -[assembly: AssemblyFileVersionAttribute("4.2.0")] -[assembly: AssemblyInformationalVersionAttribute("4.2.0")] +[assembly: AssemblyVersionAttribute("4.3.0")] +[assembly: AssemblyFileVersionAttribute("4.3.0")] +[assembly: AssemblyInformationalVersionAttribute("4.3.0")] namespace System { internal static class AssemblyVersionInformation { internal const System.String AssemblyTitle = "Paket.Bootstrapper"; internal const System.String AssemblyProduct = "Paket"; internal const System.String AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories."; - internal const System.String AssemblyVersion = "4.2.0"; - internal const System.String AssemblyFileVersion = "4.2.0"; - internal const System.String AssemblyInformationalVersion = "4.2.0"; + internal const System.String AssemblyVersion = "4.3.0"; + internal const System.String AssemblyFileVersion = "4.3.0"; + internal const System.String AssemblyInformationalVersion = "4.3.0"; } } diff --git a/src/Paket.Core/AssemblyInfo.fs b/src/Paket.Core/AssemblyInfo.fs index 0622521986..6ed9359e80 100644 --- a/src/Paket.Core/AssemblyInfo.fs +++ b/src/Paket.Core/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.2.0" - let [] AssemblyFileVersion = "4.2.0" - let [] AssemblyInformationalVersion = "4.2.0" + let [] AssemblyVersion = "4.3.0" + let [] AssemblyFileVersion = "4.3.0" + let [] AssemblyInformationalVersion = "4.3.0" diff --git a/src/Paket.PowerShell/AssemblyInfo.fs b/src/Paket.PowerShell/AssemblyInfo.fs index 8a61bd455d..214c5cb29a 100644 --- a/src/Paket.PowerShell/AssemblyInfo.fs +++ b/src/Paket.PowerShell/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.2.0" - let [] AssemblyFileVersion = "4.2.0" - let [] AssemblyInformationalVersion = "4.2.0" + let [] AssemblyVersion = "4.3.0" + let [] AssemblyFileVersion = "4.3.0" + let [] AssemblyInformationalVersion = "4.3.0" diff --git a/src/Paket/AssemblyInfo.fs b/src/Paket/AssemblyInfo.fs index fd33da5d6c..739e36aeca 100644 --- a/src/Paket/AssemblyInfo.fs +++ b/src/Paket/AssemblyInfo.fs @@ -6,9 +6,9 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do () module internal AssemblyVersionInformation = @@ -16,6 +16,6 @@ module internal AssemblyVersionInformation = let [] AssemblyProduct = "Paket" let [] AssemblyCompany = "Paket team" let [] AssemblyDescription = "A dependency manager for .NET with support for NuGet packages and git repositories." - let [] AssemblyVersion = "4.2.0" - let [] AssemblyFileVersion = "4.2.0" - let [] AssemblyInformationalVersion = "4.2.0" + let [] AssemblyVersion = "4.3.0" + let [] AssemblyFileVersion = "4.3.0" + let [] AssemblyInformationalVersion = "4.3.0" From 3d0d8c560d5f36fef0a634c519b2da9d582a6adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=BCneis?= Date: Mon, 10 Apr 2017 18:24:35 +0200 Subject: [PATCH 32/45] Fix rotating app.config entries when generating redirects --- src/Paket.Core/BindingRedirects.fs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Paket.Core/BindingRedirects.fs b/src/Paket.Core/BindingRedirects.fs index 5625a7d2f0..c3b1e7f20b 100644 --- a/src/Paket.Core/BindingRedirects.fs +++ b/src/Paket.Core/BindingRedirects.fs @@ -156,8 +156,9 @@ let private applyBindingRedirects isFirstGroup cleanBindingRedirects (allKnownLi nsManager.AddNamespace("bindings", bindingNs) config.XPathSelectElements("//bindings:assemblyBinding", nsManager) |> Seq.collect (fun e -> e.Elements(XName.Get("dependentAssembly", bindingNs))) - |> Seq.filter (fun e -> isFirstGroup && (cleanBindingRedirects || isMarked e) && libIsContained e) - |> Seq.iter (fun e -> e.Remove()) + |> List.ofSeq // strict evaluation, as otherwise e.Remove() also changes the order! + |> List.filter (fun e -> isFirstGroup && (cleanBindingRedirects || isMarked e) && libIsContained e) + |> List.iter (fun e -> e.Remove()) let config = Seq.fold setRedirect config bindingRedirects indentAssemblyBindings config From 3ace90d297c3349f73078d2b2411d3610124c872 Mon Sep 17 00:00:00 2001 From: Julien Roncaglia Date: Tue, 11 Apr 2017 21:49:58 +0200 Subject: [PATCH 33/45] Don't download boostrapper in auto-restore magic mode Fixes #2217 --- src/Paket.Core/PublicAPI.fs | 8 ++++++-- src/Paket/Program.fs | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Paket.Core/PublicAPI.fs b/src/Paket.Core/PublicAPI.fs index af4ec7aa14..d9266035ed 100644 --- a/src/Paket.Core/PublicAPI.fs +++ b/src/Paket.Core/PublicAPI.fs @@ -350,10 +350,14 @@ type Dependencies(dependenciesFileName: string) = ) /// Pulls new paket.targets and bootstrapper and puts them into .paket folder. - member this.TurnOnAutoRestore(): unit = + member this.TurnOnAutoRestore(fromBootstrapper: bool): unit = Utils.RunInLockedAccessMode( this.RootPath, - fun () -> VSIntegration.TurnOnAutoRestore false |> this.Process) + fun () -> VSIntegration.TurnOnAutoRestore fromBootstrapper |> this.Process) + + /// Pulls new paket.targets and bootstrapper and puts them into .paket folder. + member this.TurnOnAutoRestore(): unit = + this.TurnOnAutoRestore(false) /// Removes paket.targets file and Import section from project files. member this.TurnOffAutoRestore(): unit = diff --git a/src/Paket/Program.fs b/src/Paket/Program.fs index 5fc6f4ad9a..47f4c8c8fc 100644 --- a/src/Paket/Program.fs +++ b/src/Paket/Program.fs @@ -92,9 +92,9 @@ let config (results : ParseResults<_>) = let validateAutoRestore (results : ParseResults<_>) = results.GetAllResults().Length = 1 -let autoRestore (results : ParseResults<_>) = +let autoRestore (fromBootstrapper:bool) (results : ParseResults<_>) = match results.GetResult <@ Flags @> with - | On -> Dependencies.Locate().TurnOnAutoRestore() + | On -> Dependencies.Locate().TurnOnAutoRestore(fromBootstrapper) | Off -> Dependencies.Locate().TurnOffAutoRestore() let convert (fromBootstrapper:bool) (results : ParseResults<_>) = @@ -429,7 +429,7 @@ let main() = | ConvertFromNuget r -> processCommand silent (convert fromBootstrapper) r | FindRefs r -> processCommand silent findRefs r | Init r -> processCommand silent (init fromBootstrapper) r - | AutoRestore r -> processWithValidation silent validateAutoRestore autoRestore r + | AutoRestore r -> processWithValidation silent validateAutoRestore (autoRestore fromBootstrapper) r | Install r -> processCommand silent install r | Outdated r -> processCommand silent outdated r | Remove r -> processCommand silent remove r From cf2a3aa0a634167ddf4d6ad664700c54ddf665b6 Mon Sep 17 00:00:00 2001 From: Julien Roncaglia Date: Tue, 11 Apr 2017 22:10:31 +0200 Subject: [PATCH 34/45] Only include dlls in analyzers Fixes #2219 --- src/Paket.Core/NuGetV2.fs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Paket.Core/NuGetV2.fs b/src/Paket.Core/NuGetV2.fs index 477613dd4c..b80ef3dfe8 100644 --- a/src/Paket.Core/NuGetV2.fs +++ b/src/Paket.Core/NuGetV2.fs @@ -605,27 +605,29 @@ let DownloadLicense(root,force,packageName:PackageName,version:SemVerInfo,licens traceWarnfn "Could not download license for %O %O from %s.%s %s" packageName version licenseUrl Environment.NewLine exn.Message } - -let private getFiles targetFolder subFolderName filesDescriptionForVerbose = +let private getFilesMatching targetFolder searchPattern subFolderName filesDescriptionForVerbose = let files = let dir = DirectoryInfo(targetFolder) let path = Path.Combine(dir.FullName.ToLower(), subFolderName) if dir.Exists then dir.GetDirectories() |> Array.filter (fun fi -> String.equalsIgnoreCase fi.FullName path) - |> Array.collect (fun dir -> dir.GetFiles("*.*", SearchOption.AllDirectories)) + |> Array.collect (fun dir -> dir.GetFiles(searchPattern, SearchOption.AllDirectories)) else [||] if Logging.verbose then if Array.isEmpty files then - verbosefn "No %s found in %s" filesDescriptionForVerbose targetFolder + verbosefn "No %s found in %s matching %s" filesDescriptionForVerbose targetFolder searchPattern else let s = String.Join(Environment.NewLine + " - ",files |> Array.map (fun l -> l.FullName)) - verbosefn "%s found in %s:%s - %s" filesDescriptionForVerbose targetFolder Environment.NewLine s + verbosefn "%s found in %s matching %s:%s - %s" filesDescriptionForVerbose targetFolder searchPattern Environment.NewLine s files +let private getFiles targetFolder subFolderName filesDescriptionForVerbose = + getFilesMatching targetFolder "*.*" subFolderName filesDescriptionForVerbose + /// Finds all libraries in a nuget package. let GetLibFiles(targetFolder) = let libs = getFiles targetFolder "lib" "libraries" @@ -639,7 +641,7 @@ let GetLibFiles(targetFolder) = let GetTargetsFiles(targetFolder) = getFiles targetFolder "build" ".targets files" /// Finds all analyzer files in a nuget package. -let GetAnalyzerFiles(targetFolder) = getFiles targetFolder "analyzers" "analyzer dlls" +let GetAnalyzerFiles(targetFolder) = getFilesMatching targetFolder "*.dll" "analyzers" "analyzer dlls" let rec private getPackageDetails alternativeProjectRoot root force (sources:PackageSource list) packageName (version:SemVerInfo) : PackageResolver.PackageDetails = From e08c7e6dab95281480a71cade163f961efd90eb2 Mon Sep 17 00:00:00 2001 From: Julien Roncaglia Date: Tue, 11 Apr 2017 22:18:27 +0200 Subject: [PATCH 35/45] Fix Paket.Powershell --- src/Paket.PowerShell/PowerShell.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Paket.PowerShell/PowerShell.fs b/src/Paket.PowerShell/PowerShell.fs index 82ed6991f7..66d257be04 100644 --- a/src/Paket.PowerShell/PowerShell.fs +++ b/src/Paket.PowerShell/PowerShell.fs @@ -102,7 +102,7 @@ type AutoRestoreCmdlet() = yield Flags(AutoRestoreFlags.Off) ] |> parser.ToParseResults - |> Program.autoRestore + |> Program.autoRestore false } |> processWithLogging x [] From 924258a1521bbe867cffbaf56c583b4d5ec0cdb5 Mon Sep 17 00:00:00 2001 From: Lukas Rieger Date: Tue, 11 Apr 2017 21:40:04 +0200 Subject: [PATCH 36/45] import .props/.targets better fixes https://github.com/fsprojects/Paket/issues/2227 * differentiate between global targets/props, and framework specific targets/props * fw-specifc targets/props continue to be imported in the the middle with a condition (no change to before) * global props are imported at the top of the file (same as nuget does) * global targets are imported at the end of the file (same as nuget) The reason is that many props depend on being imported at the top, so do that for the files where it is actually possible. --- .../MyClassLibrary.csprojtemplate | 12 +- .../xUnitTests.expected.csprojtemplate | 9 +- src/Paket.Core/Files/ProjectFile.fs | 175 ++++++++++++------ src/Paket/Paket.fsproj | 4 +- .../InstallModel/Xml/CodeCracker.fs | 12 +- .../Paket.Tests/InstallModel/Xml/EmptyLibs.fs | 4 +- .../InstallModel/Xml/FSharp.Data.SqlClient.fs | 4 +- .../Paket.Tests/InstallModel/Xml/Fantomas.fs | 7 +- .../InstallModel/Xml/FantomasLib.fs | 4 +- tests/Paket.Tests/InstallModel/Xml/Fuchu.fs | 4 +- .../InstallModel/Xml/GitInfoPlanter.fs | 14 +- .../InstallModel/Xml/LibGit2Sharp.fs | 14 +- .../InstallModel/Xml/Microsoft.Bcl.Build.fs | 7 +- .../Xml/Microsoft.CodeAnalysis.Analyzers.fs | 12 +- tests/Paket.Tests/InstallModel/Xml/Plossum.fs | 4 +- .../InstallModel/Xml/RefactoringEssentials.fs | 8 +- tests/Paket.Tests/InstallModel/Xml/RxXaml.fs | 4 +- tests/Paket.Tests/InstallModel/Xml/SQLite.fs | 14 +- .../InstallModel/Xml/StyleCop.MSBuild.fs | 13 +- ...System.Security.Cryptography.Algorithms.fs | 4 +- .../InstallModel/Xml/System.Spatial.fs | 4 +- .../InstallModel/Xml/SystemNetHttp.fs | 4 +- .../InstallModel/Xml/SystemNetHttpForNet4.fs | 4 +- ...mNetHttpWithExistingFrameworkReferences.fs | 4 +- .../SystemNetHttpWithFrameworkReferences.fs | 4 +- .../InstallModel/Xml/xunit.runner.fs | 24 +-- 26 files changed, 219 insertions(+), 154 deletions(-) diff --git a/integrationtests/scenarios/i001487-stable-props/before/MyClassLibrary/MyClassLibrary/MyClassLibrary.csprojtemplate b/integrationtests/scenarios/i001487-stable-props/before/MyClassLibrary/MyClassLibrary/MyClassLibrary.csprojtemplate index 9c1303686e..8111003afd 100644 --- a/integrationtests/scenarios/i001487-stable-props/before/MyClassLibrary/MyClassLibrary/MyClassLibrary.csprojtemplate +++ b/integrationtests/scenarios/i001487-stable-props/before/MyClassLibrary/MyClassLibrary/MyClassLibrary.csprojtemplate @@ -1,5 +1,6 @@ + Debug 8.0.30703 @@ -69,15 +70,6 @@ - - - - <__paket__MultiTarget_props>MultiTarget - <__paket__MultiTarget_targets>MultiTarget - - - -