You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(gradle): MODULE_DEPENDS_ON is empty on multi-module Android projects; settings.gradle never parsed #1603
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.
Partially fixed by #1621 (merged), which lands the module-identity half:
settings.gradle(.kts) is now actually parsed (_SETTINGS_INCLUDE_PATTERN is no longer dead code)
: added to the path character classes, so multi-segment paths match
modules identified by canonical Gradle path, so :feature:a:impl and :feature:b:impl no longer collide on the GradleModule primary key
Verified on a four-module fixture: [':app', ':core:network', ':feature:other:impl', ':feature:symptoms'].
Keeping this open, because the headline symptom — MODULE_DEPENDS_ON empty on multi-module Android projects — still reproduces on Kotlin DSL.
gradle.py:168 requires whitespace between the configuration keyword and project(:
r"""(\w+)\s+project\(['"]:([\w.\-/:]+)['"]\)"""
Groovy implementation project(":core:network") matches; Kotlin DSL implementation(project(":core:network")) does not. Measured on two otherwise-identical fixtures:
Since build.gradle.kts is the modern Android default, the nodes are now right but the edges are still absent for most real projects. Same root cause as the _DEP_PATTERN gap noted in the original report, so both can be fixed together.
Activity
github-actions commentedon Aug 13, 2026
Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ
Shashankss1205 commentedon Aug 13, 2026
Partially fixed by #1621 (merged), which lands the module-identity half:
settings.gradle(.kts)is now actually parsed (_SETTINGS_INCLUDE_PATTERNis no longer dead code):added to the path character classes, so multi-segment paths match:feature:a:impland:feature:b:implno longer collide on theGradleModuleprimary keyVerified on a four-module fixture:
[':app', ':core:network', ':feature:other:impl', ':feature:symptoms'].Keeping this open, because the headline symptom —
MODULE_DEPENDS_ONempty on multi-module Android projects — still reproduces on Kotlin DSL.gradle.py:168requires whitespace between the configuration keyword andproject(:r"""(\w+)\s+project\(['"]:([\w.\-/:]+)['"]\)"""Groovy
implementation project(":core:network")matches; Kotlin DSLimplementation(project(":core:network"))does not. Measured on two otherwise-identical fixtures:Since
build.gradle.ktsis the modern Android default, the nodes are now right but the edges are still absent for most real projects. Same root cause as the_DEP_PATTERNgap noted in the original report, so both can be fixed together.fix(kuzu): declare build-system and datasource tables; repair UNWIND …