packagedcode: add GradleModuleHandler to parse gradle .module files#4808
Open
kumarasantosh wants to merge 1 commit intoaboutcode-org:developfrom
Open
packagedcode: add GradleModuleHandler to parse gradle .module files#4808kumarasantosh wants to merge 1 commit intoaboutcode-org:developfrom
kumarasantosh wants to merge 1 commit intoaboutcode-org:developfrom
Conversation
Add support for parsing Gradle module metadata files (.module) found in Gradle build caches at paths like: .gradle/caches/modules-2/files-2.1/<group>/<module>/<version>/ Extracts component identity (group, module, version) as a Maven PURL, collects dependencies across all variants with api/runtime scopes, deduplicates dependencies, and stores gradle version and format version in extra_data. Fixes aboutcode-org#3579 Signed-off-by: kumarasantosh <santosh.pulikond02@gmail.com>
This file contains hidden or 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
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.
Closes #3579
Gradle stores .module JSON files in its build cache containing
the package identity and all its dependencies. This adds parsing
support for those files.
The handler picks up the group, module and version from the
component section, then walks through all the variants to collect
dependencies. Dependencies that appear in multiple variants get
deduplicated. Api and runtime scopes are inferred from the
variant's usage attribute.
Tested against a real Android Material library module file and
a Spring Boot plugin module file alongside a few simpler fixtures.