-
Notifications
You must be signed in to change notification settings - Fork 297
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
Analyzer: Add support for Swift Package Manager #6114
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4f1eed2
to
ebf3962
Compare
Swift Package Manager is still very young and no other open-source scanners support it. This commit adds a new analyzer that parses Package.resolved files and creates results which are enriched with as much data as possible. Signed-off-by: UgniusV <ugniusvaznys@gmail.com> Add support for Package.swift file analysis Previously SPM analyzer would only generate SBOM from Package.resolved files. This was fine whenever the build target is an application. However, if the build target is a library, only Package.swift file would exist. This commit adds support for converting Package.swift file to Package.resolved and then parses dependencies. Signed-off-by: UgniusV <ugniusvaznys@gmail.com> Create parent-child associations for Package.swift dependencies Previously Package.swift dependencies were converted to a Package.resolved file and then parsed. By doing this, we lost dependency associations that `swift package show-dependencies --format json` command provides us. This commit parses library dependencies directly from swift CLI output and uses a dependency graph to form parent-child associates of parsed dependencies. Signed-off-by: UgniusV <ugniusvaznys@gmail.com> Throw exception when analyzing Package.swift without dynamic versions option Signed-off-by: UgniusV <ugniusvaznys@gmail.com>
1e93638
to
1f6e76a
Compare
Closing in favor of #7271. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a WIP based on #5092.