-
Notifications
You must be signed in to change notification settings - Fork 696
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
Make PackageSpecDependencyProvider consider the version being requested #5452
Changes from all commits
17c8bf0
0885442
8e230a3
e73f43a
37ec8c7
41cefd7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -86,7 +86,15 @@ public Library GetLibrary(LibraryRange libraryRange, NuGetFramework targetFramew | |||||
// This must exist in the external references | ||||||
if (_externalProjectsByUniqueName.TryGetValue(name, out ExternalProjectReference externalReference)) | ||||||
{ | ||||||
packageSpec = externalReference.PackageSpec; | ||||||
if (externalReference.PackageSpec == null || | ||||||
libraryRange.VersionRange.FindBestMatch(new NuGetVersion[] { externalReference.PackageSpec.Version }) != null) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure how this should work yet. |
||||||
{ | ||||||
packageSpec = externalReference.PackageSpec; | ||||||
} | ||||||
else | ||||||
{ | ||||||
externalReference = null; | ||||||
} | ||||||
nkolev92 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
} | ||||||
|
||||||
if (externalReference == null && packageSpec == null) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why's that? It's not intuitive to me.
I really liked the
project.json
feature, from .NET Core 1.0 pre-release days, where you could add a package's project to the build, viaglobal.json
, and then it would use the project rather than the package. I thought it was regardless of version. This makes it much easier to debug and develop a package which has a bug in another project in a different repo.Although perhaps this is straying too far from the linked bug and is a different feature request instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version check allows you to be able to explicitly depend on a package if you choose to.
Now it'd replace package with project every single time.
There's obviously a lot of feature options here, like for example, being able to control whether project o package replacement is allowed.