Skip to content

Commit

Permalink
Always write non-version into lock file to keep ProGet happy - fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Nov 19, 2015
1 parent c9f9632 commit 3a6fda8
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 58 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 9 additions & 2 deletions integrationtests/Paket.IntegrationTests/NuGetV3Specs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
2 changes: 1 addition & 1 deletion src/Paket.Core/LockFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Paket.Tests/Lockfile/GenerateAuthModeSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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)"""

[<Test>]
let ``should generate no auth in lock file``() =
Expand Down
10 changes: 5 additions & 5 deletions tests/Paket.Tests/Lockfile/GenerateWithOptionsSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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)"""

[<Test>]
let ``should generate strict lock file``() =
Expand All @@ -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)"""

[<Test>]
let ``should generate content none lock file``() =
Expand All @@ -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)"""

[<Test>]
let ``should generate redirects lock file``() =
Expand All @@ -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()
Expand All @@ -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()
Expand Down
82 changes: 41 additions & 41 deletions tests/Paket.Tests/Lockfile/GeneratorSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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)"""

[<Test>]
Expand Down Expand Up @@ -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
Expand All @@ -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)
12 changes: 6 additions & 6 deletions tests/Paket.Tests/Lockfile/GeneratorWithMutlipleSourcesSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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)"""

[<Test>]
Expand Down
4 changes: 2 additions & 2 deletions tests/Paket.Tests/Lockfile/ParserSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
"""

[<Test>]
Expand Down

0 comments on commit 3a6fda8

Please sign in to comment.