Skip to content

Conversation

@MichaelSNelson
Copy link

Summary

  • Adds a new extractor pipeline for Gradle-based Java projects (src/codezoom/extractors/gradle/)
  • Uses javalang for source-level AST parsing — no JDK or bytecode required
  • Extracts module hierarchy, inter-module dependency graph, and full symbol data (classes, methods, fields, call graphs, visibility, line numbers, inheritance)
  • Detects Gradle projects via build.gradle.kts / build.gradle and auto-selects extractors
  • Extracts project name from settings.gradle.kts / build.gradle.kts

New files

File Purpose
extractors/gradle/__init__.py Re-exports the three extractor classes
extractors/gradle/gradle_deps.py Inter-module dependency graph from source imports
extractors/gradle/source_hierarchy.py Package/module hierarchy from source tree
extractors/gradle/source_symbols.py Full symbol extraction via javalang AST parsing

Modified files

  • pyproject.toml — adds javalang as optional [gradle] dependency
  • detect.py — auto-detects Gradle projects and registers extractors
  • pipeline.py — Gradle project name guessing + skip package discovery for Gradle projects

Test plan

  • Tested against multiple Gradle-based QuPath extension projects
  • Verified codemap JSON output includes hierarchy, imports, and symbol data
  • Upstream review and feedback

🤖 Generated with Claude Code

Adds a new extractor pipeline for Gradle-based Java projects using
javalang for source-level AST parsing (no JDK/bytecode required).
Includes module hierarchy, inter-module dependency graph, and full
symbol extraction (classes, methods, fields, call graphs, visibility,
line numbers, inheritance).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
javalang hasn't been updated since 2018 and can't parse Java 14+ features.
Generalize the existing Maven bytecode extractors (jdeps/javap) to handle
both Maven and Gradle projects by detecting the appropriate classes
directory, and remove the source-level javalang-based extractors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ctrueden
Copy link
Member

Thanks for the PR, @MichaelSNelson! I rebased it over the current main branch, and added a commit to remove the use of javalang, because that project can't handle newer versions of Java used by QuPath. Could you give it a try on your QuPath extensions and let me know how it goes? Or even just point me at a project you'd like me to use for further testing?

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.

2 participants