Split out of #1595 (report 6 of 9) — filed by @rrodriguesNutrium, credit to them. Described as the most consequential one for multi-module Android projects.
Three compounding defects in gradle.py:
1. _SETTINGS_INCLUDE_PATTERN (gradle.py:22) is dead code. It appears exactly once in the file — its own definition. There is no settings.gradle parsing pass at all, so declared module includes never reach the graph.
2. The path character classes omit :. Both _SETTINGS_INCLUDE_PATTERN and _PROJECT_DEP_PATTERN (gradle.py:19) use ([\\w.\\-/]+), which cannot match a colon:
include(":feature:symptoms") -> NO MATCH
include(":app") -> app
implementation(project(":feature:symptoms")) -> NO MATCH
implementation(project(":core:network")) -> NO MATCH
Only single-segment modules match, so on a standard Android multi-module layout MODULE_DEPENDS_ON is empty — edges missing, failing silently.
3. Module identity is the leaf directory. gradle.py:47 uses module_name = gradle_path.parent.name, so :feature:a:impl and :feature:b:impl both become impl and collide on GradleModule's MERGE key (writer.py:1533) — two distinct modules merge into one node.
A fix needs : in the path character classes, a real settings.gradle pass, and canonical :a:b:c identity used consistently on both the nodes and both endpoints of the dependency lookups (writer.py:1543-1560) — changing one side alone silently yields zero edges.
Also noted while there: _DEP_PATTERN (gradle.py:13) does not match Kotlin-DSL parenthesized dependency literals, so implementation(\"group:artifact:version\") declarations are missed for ExternalLibrary extraction.
The reporter has a working fix for the identity and settings-parsing parts on a local branch.
Split out of #1595 (report 6 of 9) — filed by @rrodriguesNutrium, credit to them. Described as the most consequential one for multi-module Android projects.
Three compounding defects in
gradle.py:1.
_SETTINGS_INCLUDE_PATTERN(gradle.py:22) is dead code. It appears exactly once in the file — its own definition. There is nosettings.gradleparsing pass at all, so declared module includes never reach the graph.2. The path character classes omit
:. Both_SETTINGS_INCLUDE_PATTERNand_PROJECT_DEP_PATTERN(gradle.py:19) use([\\w.\\-/]+), which cannot match a colon:Only single-segment modules match, so on a standard Android multi-module layout
MODULE_DEPENDS_ONis empty — edges missing, failing silently.3. Module identity is the leaf directory.
gradle.py:47usesmodule_name = gradle_path.parent.name, so:feature:a:impland:feature:b:implboth becomeimpland collide onGradleModule's MERGE key (writer.py:1533) — two distinct modules merge into one node.A fix needs
:in the path character classes, a realsettings.gradlepass, and canonical:a:b:cidentity used consistently on both the nodes and both endpoints of the dependency lookups (writer.py:1543-1560) — changing one side alone silently yields zero edges.Also noted while there:
_DEP_PATTERN(gradle.py:13) does not match Kotlin-DSL parenthesized dependency literals, soimplementation(\"group:artifact:version\")declarations are missed forExternalLibraryextraction.The reporter has a working fix for the identity and settings-parsing parts on a local branch.