diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 9f251c195f..5d3a1251ef 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 2.26.2 - 18.11.2015 +* USABILITY: Always write non-version into lock file to keep ProGet happy - https://github.com/fsprojects/Paket/issues/1239 + #### 2.26.1 - 18.11.2015 * BUGFIX: Better parsing of framework restrictions - https://github.com/fsprojects/Paket/issues/1232 * BUGFIX: Fix props files - https://github.com/fsprojects/Paket/issues/1233 diff --git a/integrationtests/Paket.IntegrationTests/NuGetV3Specs.fs b/integrationtests/Paket.IntegrationTests/NuGetV3Specs.fs index a3c7e81086..c3d0af7e38 100644 --- a/integrationtests/Paket.IntegrationTests/NuGetV3Specs.fs +++ b/integrationtests/Paket.IntegrationTests/NuGetV3Specs.fs @@ -14,7 +14,14 @@ open Paket.Domain let ``#1211 update with V3 API should work exactly like V2 API``() = let lockFileV2 = update "i001211-top-level-v2" let lockFileV3 = update "i001211-top-level-v3" - lockFileV3.ToString() - |> shouldEqual (lockFileV2.ToString().Replace("remote: https://nuget.org/api/v2", "remote: http://api.nuget.org/v3/index.json")) + + let normalize (s:string) = + s.Replace(".0.0",".0") + |> normalizeLineEndings + + lockFileV3.ToString() + |> normalize + |> shouldEqual + (lockFileV2.ToString().Replace("remote: https://nuget.org/api/v2", "remote: http://api.nuget.org/v3/index.json") |> normalize) lockFileV3.Groups.[Constants.MainDependencyGroup].Resolution.[PackageName "FsLexYacc.Runtime"].Version |> shouldBeGreaterThan (SemVer.Parse "6") \ No newline at end of file diff --git a/src/Paket.Core/LockFile.fs b/src/Paket.Core/LockFile.fs index 04f6bb1017..7199a06c89 100644 --- a/src/Paket.Core/LockFile.fs +++ b/src/Paket.Core/LockFile.fs @@ -77,7 +77,7 @@ module LockFileSerializer = for _,_,package in packages |> Seq.sortBy (fun (_,_,p) -> p.Name) do let versionStr = let s = package.Version.ToString() - if s = "" then s else "(" + package.Version.Normalize() + ")" + if s = "" then s else "(" + s + ")" let settings = if package.Settings.FrameworkRestrictions = options.Settings.FrameworkRestrictions then diff --git a/tests/Paket.Tests/Lockfile/GenerateAuthModeSpecs.fs b/tests/Paket.Tests/Lockfile/GenerateAuthModeSpecs.fs index 735c97c957..9d154d46a4 100644 --- a/tests/Paket.Tests/Lockfile/GenerateAuthModeSpecs.fs +++ b/tests/Paket.Tests/Lockfile/GenerateAuthModeSpecs.fs @@ -19,7 +19,7 @@ let graph = [ let expected = """NUGET remote: http://nuget.org/api/v2 specs: - Castle.Windsor-log4net (3.2.0)""" + Castle.Windsor-log4net (3.2)""" [] let ``should generate no auth in lock file``() = diff --git a/tests/Paket.Tests/Lockfile/GenerateWithOptionsSpecs.fs b/tests/Paket.Tests/Lockfile/GenerateWithOptionsSpecs.fs index 92867b9b1c..b95f0065cc 100644 --- a/tests/Paket.Tests/Lockfile/GenerateWithOptionsSpecs.fs +++ b/tests/Paket.Tests/Lockfile/GenerateWithOptionsSpecs.fs @@ -25,7 +25,7 @@ FRAMEWORK: >= NET45 NUGET remote: http://nuget.org/api/v2 specs: - Castle.Windsor-log4net (3.2.0)""" + Castle.Windsor-log4net (3.2)""" [] let ``should generate strict lock file``() = @@ -52,7 +52,7 @@ CONTENT: NONE NUGET remote: http://nuget.org/api/v2 specs: - Microsoft.SqlServer.Types (1.0.0)""" + Microsoft.SqlServer.Types (1.0)""" [] let ``should generate content none lock file``() = @@ -76,7 +76,7 @@ let expected3 = """REDIRECTS: ON NUGET remote: http://nuget.org/api/v2 specs: - Microsoft.SqlServer.Types (1.0.0)""" + Microsoft.SqlServer.Types (1.0)""" [] let ``should generate redirects lock file``() = @@ -98,7 +98,7 @@ let ``should generate strategy min lock file``() = NUGET remote: http://nuget.org/api/v2 specs: - Microsoft.SqlServer.Types (1.0.0)""" + Microsoft.SqlServer.Types (1.0)""" let cfg = DependenciesFile.FromCode(config) ResolveWithGraph(cfg,noSha1,VersionsFromGraphAsSeq graph3, PackageDetailsFromGraph graph3).[Constants.MainDependencyGroup].ResolvedPackages.GetModelOrFail() @@ -118,7 +118,7 @@ let ``should generate strategy max lock file``() = NUGET remote: http://nuget.org/api/v2 specs: - Microsoft.SqlServer.Types (1.0.0)""" + Microsoft.SqlServer.Types (1.0)""" let cfg = DependenciesFile.FromCode(config) ResolveWithGraph(cfg,noSha1,VersionsFromGraphAsSeq graph3, PackageDetailsFromGraph graph3).[Constants.MainDependencyGroup].ResolvedPackages.GetModelOrFail() diff --git a/tests/Paket.Tests/Lockfile/GeneratorSpecs.fs b/tests/Paket.Tests/Lockfile/GeneratorSpecs.fs index 0c1073678e..5c09397fdd 100644 --- a/tests/Paket.Tests/Lockfile/GeneratorSpecs.fs +++ b/tests/Paket.Tests/Lockfile/GeneratorSpecs.fs @@ -33,15 +33,15 @@ let ``should generate lock file for packages``() = let expected = """NUGET remote: http://nuget.org/api/v2 specs: - Castle.Windsor (2.1.0) - Castle.Windsor-log4net (3.3.0) + Castle.Windsor (2.1) + Castle.Windsor-log4net (3.3) Castle.Windsor (>= 2.0) log4net (>= 1.0) - log (1.2.0) - log4net (1.1.0) + log (1.2) + log4net (1.1) log (>= 1.0) - Rx-Core (2.1.0) - Rx-Main (2.0.0) + Rx-Core (2.1) + Rx-Main (2.0) Rx-Core (>= 2.1)""" let cfg = DependenciesFile.FromCode(config1) @@ -60,15 +60,15 @@ let ``should generate lock file with framework restrictions for packages``() = let expected = """NUGET remote: http://nuget.org/api/v2 specs: - Castle.Windsor (2.1.0) - framework: net35 - Castle.Windsor-log4net (3.3.0) - framework: net35 + Castle.Windsor (2.1) - framework: net35 + Castle.Windsor-log4net (3.3) - framework: net35 Castle.Windsor (>= 2.0) log4net (>= 1.0) - log (1.2.0) - framework: net35 - log4net (1.1.0) - framework: net35 + log (1.2) - framework: net35 + log4net (1.1) - framework: net35 log (>= 1.0) - Rx-Core (2.1.0) - framework: >= net40 - Rx-Main (2.0.0) - framework: >= net40 + Rx-Core (2.1) - framework: >= net40 + Rx-Main (2.0) - framework: >= net40 Rx-Core (>= 2.1)""" let cfg = DependenciesFile.FromCode(configWithRestrictions) @@ -88,15 +88,15 @@ let ``should generate lock file with no targets import for packages``() = let expected = """NUGET remote: "D:\code\temp with space" specs: - Castle.Windsor (2.1.0) - import_targets: false, framework: net35 - Castle.Windsor-log4net (3.3.0) - import_targets: false, framework: net35 + Castle.Windsor (2.1) - import_targets: false, framework: net35 + Castle.Windsor-log4net (3.3) - import_targets: false, framework: net35 Castle.Windsor (>= 2.0) log4net (>= 1.0) - log (1.2.0) - import_targets: false, framework: net35 - log4net (1.1.0) - import_targets: false, framework: net35 + log (1.2) - import_targets: false, framework: net35 + log4net (1.1) - import_targets: false, framework: net35 log (>= 1.0) - Rx-Core (2.1.0) - framework: >= net40 - Rx-Main (2.0.0) - framework: >= net40 + Rx-Core (2.1) - framework: >= net40 + Rx-Main (2.0) - framework: >= net40 Rx-Core (>= 2.1)""" let cfg = DependenciesFile.FromCode(configWithNoImport) @@ -115,15 +115,15 @@ let ``should generate lock file with no copy local for packages``() = let expected = """NUGET remote: http://nuget.org/api/v2 specs: - Castle.Windsor (2.1.0) - copy_local: false, import_targets: false, framework: net35 - Castle.Windsor-log4net (3.3.0) - copy_local: false, import_targets: false, framework: net35 + Castle.Windsor (2.1) - copy_local: false, import_targets: false, framework: net35 + Castle.Windsor-log4net (3.3) - copy_local: false, import_targets: false, framework: net35 Castle.Windsor (>= 2.0) log4net (>= 1.0) - log (1.2.0) - copy_local: false, import_targets: false, framework: net35 - log4net (1.1.0) - copy_local: false, import_targets: false, framework: net35 + log (1.2) - copy_local: false, import_targets: false, framework: net35 + log4net (1.1) - copy_local: false, import_targets: false, framework: net35 log (>= 1.0) - Rx-Core (2.1.0) - framework: >= net40 - Rx-Main (2.0.0) - framework: >= net40 + Rx-Core (2.1) - framework: >= net40 + Rx-Main (2.0) - framework: >= net40 Rx-Core (>= 2.1)""" let cfg = DependenciesFile.FromCode(configWithCopyLocal) ResolveWithGraph(cfg,noSha1,VersionsFromGraphAsSeq graph, PackageDetailsFromGraph graph).[Constants.MainDependencyGroup].ResolvedPackages.GetModelOrFail() @@ -142,15 +142,15 @@ let ``should generate lock file with disabled content for packages``() = let expected = """NUGET remote: http://nuget.org/api/v2 specs: - Castle.Windsor (2.1.0) - framework: net35 - Castle.Windsor-log4net (3.3.0) - framework: net35 + Castle.Windsor (2.1) - framework: net35 + Castle.Windsor-log4net (3.3) - framework: net35 Castle.Windsor (>= 2.0) log4net (>= 1.0) - log (1.2.0) - framework: net35 - log4net (1.1.0) - framework: net35 + log (1.2) - framework: net35 + log4net (1.1) - framework: net35 log (>= 1.0) - Rx-Core (2.1.0) - content: none, framework: >= net40 - Rx-Main (2.0.0) - content: none, framework: >= net40 + Rx-Core (2.1) - content: none, framework: >= net40 + Rx-Main (2.0) - content: none, framework: >= net40 Rx-Core (>= 2.1)""" let cfg = DependenciesFile.FromCode(configWithDisabledContent) ResolveWithGraph(cfg,noSha1,VersionsFromGraphAsSeq graph, PackageDetailsFromGraph graph).[Constants.MainDependencyGroup].ResolvedPackages.GetModelOrFail() @@ -228,12 +228,12 @@ let graph3 = [ let expected3 = """NUGET remote: http://nuget.org/api/v2 specs: - GreaterThan.Package (2.1.0) + GreaterThan.Package (2.1) Maximum.Package (<= 3.0) - LessThan.Package (1.9.0) + LessThan.Package (1.9) GreaterThan.Package (> 2.0) - Maximum.Package (2.9.0) - OtherVersionRanges.Package (1.0.0) + Maximum.Package (2.9) + OtherVersionRanges.Package (1.0) LessThan.Package (< 2.0)""" [] @@ -359,15 +359,15 @@ let ``should generate lock file with second group``() = let expected = """NUGET remote: http://nuget.org/api/v2 specs: - Castle.Windsor (2.1.0) - Castle.Windsor-log4net (3.3.0) - framework: net35 + Castle.Windsor (2.1) + Castle.Windsor-log4net (3.3) - framework: net35 Castle.Windsor (>= 2.0) log4net (>= 1.0) - log (1.2.0) - log4net (1.1.0) + log (1.2) + log4net (1.1) log (>= 1.0) - Rx-Core (2.1.0) - content: none - Rx-Main (2.0.0) - content: none, framework: >= net40 + Rx-Core (2.1) - content: none + Rx-Main (2.0) - content: none, framework: >= net40 Rx-Core (>= 2.1) GROUP Build @@ -376,7 +376,7 @@ CONDITION: LEGACY NUGET remote: http://nuget.org/api/v2 specs: - FAKE (4.0.0) + FAKE (4.0) """ let lockFile = LockFile.Parse("Test",toLines expected) lockFile.ToString() |> normalizeLineEndings |> shouldEqual (normalizeLineEndings expected) \ No newline at end of file diff --git a/tests/Paket.Tests/Lockfile/GeneratorWithMutlipleSourcesSpecs.fs b/tests/Paket.Tests/Lockfile/GeneratorWithMutlipleSourcesSpecs.fs index 5e0dc56b80..1dec994be1 100644 --- a/tests/Paket.Tests/Lockfile/GeneratorWithMutlipleSourcesSpecs.fs +++ b/tests/Paket.Tests/Lockfile/GeneratorWithMutlipleSourcesSpecs.fs @@ -31,15 +31,15 @@ let graph = [ let expected = """NUGET remote: http://nuget.org/api/v2 specs: - Castle.Windsor (2.1.0) - Castle.Windsor-log4net (3.3.0) + Castle.Windsor (2.1) + Castle.Windsor-log4net (3.3) Castle.Windsor (>= 2.0) log4net (>= 1.0) - log (1.2.0) - log4net (1.1.0) + log (1.2) + log4net (1.1) log (>= 1.0) - Rx-Core (2.1.0) - Rx-Main (2.0.0) + Rx-Core (2.1) + Rx-Main (2.0) Rx-Core (>= 2.1)""" [] diff --git a/tests/Paket.Tests/Lockfile/ParserSpecs.fs b/tests/Paket.Tests/Lockfile/ParserSpecs.fs index 8610adcd59..8c8ee02a0d 100644 --- a/tests/Paket.Tests/Lockfile/ParserSpecs.fs +++ b/tests/Paket.Tests/Lockfile/ParserSpecs.fs @@ -524,7 +524,7 @@ IMPORT-TARGETS: TRUE NUGET remote: "D:\code\temp with space" specs: - Castle.Windsor (2.1.0) + Castle.Windsor (2.1) GROUP Build REDIRECTS: ON @@ -533,7 +533,7 @@ CONDITION: LEGACY NUGET remote: "D:\code\temp with space" specs: - FAKE (4.0.0) - redirects: on + FAKE (4.0) - redirects: on """ []