-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[SBRP Usage Report] Add target pack support and scan project.assets.json files for package downloads #47916
[SBRP Usage Report] Add target pack support and scan project.assets.json files for package downloads #47916
Conversation
9a49ca7
to
e89f88d
Compare
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.
Pull Request Overview
This PR enhances the SBRP Usage Report task by adding support for target packs and scanning project.assets.json files to capture package download information.
- Updates the ReadSbrpPackages method to use a new directory structure.
- Introduces a new TrackPackageReference method to consolidate package reference tracking.
- Modifies package scanning to process DownloadDependencies in addition to traditional library references.
Files not reviewed (1)
- src/SourceBuild/content/eng/Versions.props: Language not supported
Comments suppressed due to low confidence (1)
src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/WriteSbrpUsageReport.cs:191
- The use of '[]' to initialize referencedTfms is not valid C# syntax. Consider replacing it with 'new HashSet()' to correctly instantiate an empty HashSet.
referencedTfms = [];
} | ||
} | ||
|
||
private void TrackPackageReference(string lockFilePath, string? name, string? version, IEnumerable<string>? tfms) |
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.
I'd prefer to have an empty enumerable rather than it be nullable. That should simplify the implementation a bit.
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.
Fixed with 5290ff0.
Fixes dotnet/source-build#4924
Requires dotnet/source-build-reference-packages#1210 which is flowing in with #47917 and a rebootstrap.