-
Notifications
You must be signed in to change notification settings - Fork 0
How it works
pfranccino edited this page Jun 15, 2026
·
1 revision
- If
settings.gradle.ktsorsettings.gradleexists at the root, it is used as the source of truth (extractsinclude(":module")entries). - If not,
rglob()finds allbuild.gradle*files as a fallback. - Paths → names:
payments/home→payments:home.
- Reads each
build.gradle/build.gradle.kts. - For
.kts: uses tree-sitter (if installed) to get a real AST — handles multiline, comments, and named parameters. Falls back to regex if not available. - For
.gradle: preprocesses the content (strips//and/* */comments, collapses multiline declarations) and applies regex. - Supports the classic format (
project(":foo:bar")) and type-safe accessors (projects.foo.barBaz). - Exact matching against the list of known modules — no prefix heuristics.
The dynamic engine (
--engine dynamic) replaces steps 1–4 by running Gradle and reading what it resolves. See Static vs Dynamic Engine.
- Classifies modules by type (common, gateway, features).
- Applies colors based on classification.
- Generates PlantUML/Mermaid grouped by visual category.
- Marks modules involved in cycles in red.
In gradle_analyzer.py, function generate_plantuml():
"skinparam nodesep 150", # Horizontal
"skinparam ranksep 150", # Vertical
"skinparam padding 30", # Internal| Style | nodesep / ranksep / padding |
|---|---|
| Compact | 60 / 60 / 10 |
| Balanced | 100 / 100 / 20 |
| Spacious | 150 / 150 / 30 |
android-gradle-analyzer/
├── README.md
├── EXAMPLES.md
├── CHANGELOG.md · LICENSE · CONTRIBUTING.md
├── pyproject.toml ← single source of dependencies
├── menu.py ← wrapper: python3 menu.py
├── menu/ ← interactive menu package
│ ├── actions.py · branding.py · exporter.py
│ ├── prompts.py · state.py · ui.py
├── analyzer_utils.py ← shared utilities
├── dependency_engine.py ← dynamic engine (via Gradle)
├── analyzer_config.example.json ← example config
├── gradle_analyzer.py ← tool 1: internal dependencies
├── external_callers.py ← tool 2: external callers
├── gradle_sanity.py ← tool 3: sanity + score
├── gradle_impact.py ← tool 4: change impact
├── examples/
│ └── github-actions-dependency-health.yml
├── scripts/
│ ├── bump_version.py ← syncs version and guides the release
│ └── extract_changelog.py
└── tests/ ← test suite + reproducible fixtures