module-graph icon indicating copy to clipboard operation
module-graph copied to clipboard

feat: enable custom graph model input

Open powlaa opened this issue 3 months ago โ€ข 0 comments

๐Ÿš€ Description

Adds support for providing a custom graph model input so that the task can be extended to render a custom graph. Previously, the plugin only allowed generation of graphs based on the detected module relationships within a Gradle project.

To enable this, I have changed the visibility from internal to public for:

  • graphModels and projectDirectory since these are the fields that need to be set
  • Module and GraphParseResult to allow import of these classes in order to create the necessary data structure
  • GraphConfig.Builder.build() to enable creation of a GraphConfig object

๐Ÿ“„ Motivation and Context

In some scenarios, users may want to visualise relationships beyond Gradle's built-in module model, i. e. external dependencies. By allowing a custom graph model to be provided, the plugin can now support these extended use cases without affecting existing functionality.

๐Ÿงช How Has This Been Tested?

  • Tested locally with both
    • Standard Gradle projects (no custom graph input) to verify graphs continue to generate as before
    • Custom Graph model input to confirm correct Mermaid graph output (using the sample given in the README.md)

๐Ÿ“ฆ Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

โœ… Checklist

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [x] I have updated the documentation accordingly.

powlaa avatar Oct 24 '25 07:10 powlaa