module-graph
module-graph copied to clipboard
feat: enable custom graph model input
๐ 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:
-
graphModelsandprojectDirectorysince these are the fields that need to be set -
ModuleandGraphParseResultto allow import of these classes in order to create the necessary data structure -
GraphConfig.Builder.build()to enable creation of aGraphConfigobject
๐ 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.