Skip to content

packagedcode: add GradleModuleHandler to parse gradle .module files#4808

Open
kumarasantosh wants to merge 1 commit intoaboutcode-org:developfrom
kumarasantosh:feature/gradle-module-handler
Open

packagedcode: add GradleModuleHandler to parse gradle .module files#4808
kumarasantosh wants to merge 1 commit intoaboutcode-org:developfrom
kumarasantosh:feature/gradle-module-handler

Conversation

@kumarasantosh
Copy link

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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect and collect dependencies from gradle cache

1 participant