Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2419. Try parse SemVerInfo from .nupkg file name for localFolder nuget source #2422

Merged
merged 1 commit into from
Jun 16, 2017

Conversation

lexarchik
Copy link
Contributor

@lexarchik lexarchik commented Jun 15, 2017

fixes #2419

@forki
Copy link
Member

forki commented Jun 15, 2017

wow this looks very good!

@@ -41,16 +52,18 @@ let findLocalPackage directory (packageName:PackageName) (version:SemVerInfo) =
let v2 = FileInfo(Path.Combine(directory, sprintf "%O.%s.nupkg" packageName normalizedVersion))
if v2.Exists then v2 else

let condition x =
match parsePackageInfoFromFileName x with
| Some (name, ver) -> packageName.Equals name && version.Equals ver
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not | Some (name, ver) -> packageName = name && version = ver?

("package.name.with.dots.1.2.3-alpha2.nupkg", Some (PackageName "package.name.with.dots", SemVer.Parse "1.2.3-alpha2"));
("package.1.2.3.nupkg.back", None);
("package.name.without.version.nupkg", None);
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

     [ 
         "package.1.2.3.nupkg", Some (PackageName "package", SemVer.Parse "1.2.3")
         "package.1.2.3-alpha2.nupkg", Some (PackageName "package", SemVer.Parse "1.2.3-alpha2")
         "package.name.with.dots.1.2.3-alpha2.nupkg", Some (PackageName "package.name.with.dots", SemVer.Parse "1.2.3-alpha2") 
         "package.1.2.3.nupkg.back", None
         "package.name.without.version.nupkg", None
     ]

[<Test>]
let ``package file picked up correctly``() =
[ // folder * inputPackageId * inputPackageVersion * expectedFileName
"./NuGetLocal/case1", PackageName "package.name", SemVer.Parse "0.1.0-alpha2", "package.name.0.1.0-alpha2.nupkg";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary semicolons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, fix all three places

@forki
Copy link
Member

forki commented Jun 15, 2017

travis failures seem unrelated.
I guess the timeouts are because NuGet forbi to use their fastest API. ;-)

@matthid
Copy link
Member

matthid commented Jun 15, 2017

For the travis failure we will soon have #2423
Interestingly it seems that NuGet is not to blame but mono (who would have thought from the error message)...
For now we can just hammer the repeat build button until we get a fixed mono version :/

@forki forki merged commit 8ebbdd0 into fsprojects:master Jun 16, 2017
@lexarchik lexarchik deleted the folder_source branch June 16, 2017 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paket can pick a wrong package if source is local folder
4 participants