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

Handle package reference version ranges in .csproj files #814

Merged
merged 2 commits into from
Apr 6, 2017

Conversation

DustinCampbell
Copy link
Contributor

When I did the initial punch through to get package references working in .csproj, I failed to account for version ranges. This should address the unresolved dependencies warnings reported in #795.

@@ -5,21 +5,20 @@ namespace OmniSharp.MSBuild.ProjectFile
{
public class PackageReference : IEquatable<PackageReference>
{
public PackageIdentity Identity { get; }
public PackageDependency Identity { get; }
Copy link
Member

Choose a reason for hiding this comment

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

maybe you'd want to go from public PackageIdentity Identity { get; } to public PackageDependency Dependency { get; } instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes -- thanks!

{
NuGetVersion version;
if (NuGetVersion.TryParse(propertyValue.Trim(), out version))
if (VersionRange.TryParse(propertyValue.Trim(), out var version))
Copy link
Member

Choose a reason for hiding this comment

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

maybe I'm weird but doesn't it strike you as a bit inconsistent that in the same namespace they'd have two different naming styles - NuGetVersion and VersionRange (used for, well, NuGetVersions)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a bunch of them: NuGetVersion, SemanticVersion, VersionRange, FloatRange. They're all in NuGet.Versioning. NuGetVersion is a specific version, used for package identity. A range wouldn't be suitable for that.

Copy link
Member

@filipw filipw left a comment

Choose a reason for hiding this comment

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

:shipit: :shipit:

@filipw filipw merged commit 24fe1b0 into OmniSharp:dev Apr 6, 2017
@DustinCampbell DustinCampbell deleted the fix-version-ranges branch May 9, 2017 12:35
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.

2 participants