-
Notifications
You must be signed in to change notification settings - Fork 122
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
Find packages from Nuget fallback folders if possible #366
Conversation
+ raise error if json can't be parsed + set dependency error if path isn't found based on solution by paveliak from #273
@zarenner 👋 can you review this PR? I'm pretty confident it should be ok, but the sanity check on nuget usage and patterns as well as the extra set of eyes would be appreciated! |
lib/licensed/sources/nuget.rb
Outdated
id = "#{name}-#{version}" | ||
|
||
path = full_dependency_path(reference_key) | ||
error = "Package #{id} not found at any project package folder" if path.nil? |
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.
Won't path
also be nil
if for some reason it's missing under libraries -> reference_key
-> path? Not a big deal but the error will be slightly incorrect.
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.
(feel free to ignore, I don't think this is important enough to differentiate on, but perhaps you want to clarify the message)
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.
👍 good catch
lgtm! |
## 3.1.0 2021-06-16 ### Added - Licensed supports Swift/Swift package manager as a dependency source (:tada: @mattt #363)' ### Changed - The `source_path` configuration property accepts arrays of inclusion and exclusion glob patterns (#368) - The Nuget source now uses configured fallback folders to find dependencies that are not in found in the project folder (#366) - The Nuget source supports a configurable property for the path from the project source path to the project's `obj` folder (#365) ### Fixed - The Go source's checks for local packages will correctly find paths in case-insensitive file systems (#370) - The Bundler source will no longer unnecessarily reset the local Bundler environment configuration (#372)
closes #352
This gives an alternate solution to #273. I opted to start a new branch because that PR/branch had become stale and it was a bit quicker to build on the ideas rather than building directly on the code.
I've given attribution to @paveliak in the commit comment, and here as well I guess 😄 . @paveliak if there's another way you'd like me to represent your input in these changes please let me know 🙏 !
Some other changes that came along as I better understood the json file format and the code here:
Licensed::Sources::Source::Error
error if the json file can't be parsed. This is a special error class that signals a source enumerator-wide error.nil
, which doesn't work with the default scenario.Set
to enforce uniqueness, though now the uniqueness is enforced forreference_key
values and not computedid
values.