Class: Archsight::Import::Handlers::JavaGrapher
- Inherits:
-
Grapher
- Object
- Archsight::Import::Handler
- Grapher
- Archsight::Import::Handlers::JavaGrapher
- Defined in:
- lib/archsight/import/handlers/java_grapher.rb
Overview
JavaGrapher handler - analyses a Java repository and generates a GraphViz DOT graph of its package/module structure, stored as architecture/modules on the TechnologyArtifact so it can be rendered in the frontend.
Understands Maven (pom.xml) single and multi-module projects as well as Gradle (build.gradle / settings.gradle) layouts. Scanning is pure Ruby — no JDK or build tool installation required.
Configuration:
import/config/path - Path to the Java repository root
import/config/ranksep - Horizontal gap between rank columns (default: 0.6)
import/config/nodesep - Vertical gap between nodes in a column (default: 0.15)
Constant Summary collapse
- SKIP_DIRS =
%w[test tests generated target build .git node_modules .gradle resources].freeze
- MAX_PKG_DEPTH =
Cap relative package depth at 2 levels to keep the graph readable. Packages deeper than this are folded into their depth-2 ancestor.
2
Constants inherited from Grapher
Instance Attribute Summary
Attributes inherited from Archsight::Import::Handler
#database, #import_resource, #progress, #resources_dir, #shared_writer
Class Method Summary collapse
Methods inherited from Grapher
#dot_graph, #execute, #safe_glob
Methods inherited from Archsight::Import::Handler
#compute_config_hash, #config, #config_all, #execute, #import_yaml, #initialize, #resource_yaml, #resources_to_yaml, #self_marker, #write_generates_meta, #write_yaml
Constructor Details
This class inherits a constructor from Archsight::Import::Handler
Class Method Details
.applicable?(path) ⇒ Boolean
22 23 24 25 26 27 |
# File 'lib/archsight/import/handlers/java_grapher.rb', line 22 def self.applicable?(path) File.exist?(File.join(path, "pom.xml")) || File.exist?(File.join(path, "build.gradle")) || File.exist?(File.join(path, "build.gradle.kts")) || Dir.glob(File.join(path, "*/pom.xml")).any? end |
.language_name ⇒ Object
20 |
# File 'lib/archsight/import/handlers/java_grapher.rb', line 20 def self.language_name = "java" |