A Gradle plugin which creates a dependency node diagram graph about your internal modules dependencies. The plugin uses the build-graph-dependencies command to create the dependency node diagram graph.
The gradle dependency tree command is a Gradle plugin which creates a dependency node diagram graph about your internal modules dependencies.
Graphfity generates a dependency nodes diagram graph of your internal module dependencies, which is particularly helpful if you’re working on a multi-module project.
View Demo Report a Bug Make a Feature Request
Contents Table of Contents
- The Project’s Background
- The First Steps
- Usage
- Roadmap
- Contributing
- License
- Contact
The Project’s Background
As a software developer, you should be aware of how difficult it is to sustain a project without a solid foundation. As the project grows, additional libraries, features, and internal module requirements are introduced…
The goal of this plugin is to aid in the visualization of all project dependencies between internal modules as the project develops, providing a primary screenshot of all features, libraries, core modules, components, or any other kind of module you wish to analyze in your project.
Designed by
- Graphviz is a graph visualizing application.
- Kotlin-DSL A contemporary language like as Kotlin may be used as a replacement to the conventional DSL that’s groovy.
- Kotlin Java’s inevitable development towards a contemporary, compact, and cost-effective programming language
The First Steps
Prerequisites
Full setup instructions may be found at https://graphviz.org/download/.
Mac 🍏
Option #1
sudo port install graphviz graphviz graphviz graphviz graphviz graphviz graphviz graph
Option #2
graphviz (brew install graphviz)
XP/Vista/XP/Vist
Option #1
install graphviz using winget
Option #2
graphviz install choco
Linux 🐧
Option #1
sudo apt-get install graphviz graphviz
Option #2
graphviz sudo yum install
Option #3
sudo apt-get install graphviz graphviz
Installation
DSL that’s groovy
build.gradle (root)
com.github.ivancarras.graphfity.plugin.main.GraphfityPlugin com.github.ivancarras.graphfity.plugin.main.GraphfityPlugin com.github.ivancarras.graphfity.plugin.main.GraphfityPlugin com.github.ivancarras.graphfity.plugin.main.GraphfityPlugin com.github.ivanc
DSL in Kotlin
build.gradle.kts is the base build.gradle.kts file.
version “1.0.0” of plugins id(“com.github.ivancarras.graphfity”) classpath(‘com.github.ivancarras:graphfity-plugin:1.0.0’) apply(plugin = “com.github.ivancarras.graphfity.plugin.main.GraphfityPlugin”) buildscript repositories maven url = uri(“https://plugins.gradle.org/m2/”) dependencies classpath(‘com.github.ivancarras:graphfity-plugin
Configuration of the plugin
The plugin has three setup options:
- nodeTypesPath (required): the location of your json node types configuration file (explanation below)
- projectRootName (optional): the starting point for drawing dependencies from the task; the default value is the “:app” module.
- graphImagePath (optional): the path to your graph picture.
NodeTypes.json
This is the file that defines your project’s various nodeTypes. A project split into the following sections would be an excellent example:
- App
- Features
- Components
- Libraries
- Core
nodeTypes.json
[ “name”: “App”, “regex”: “:app$”, “isEnabled”: true, “shape”: “box3d”, “fillColor”: “#BAFFC9”, “name”: “Feature”, “regex”: “.*feature.*$”, “isEnabled”: true, “shape”: “tab”, “fillColor”: “#E6F98A”, “name”: “Feature”, ” “name”: “Component”, “regex”: “.*component.*$”, “isEnabled”: true, “shape”: “component”, “fillColor”: “#8AD8F9”, “isEnabled”: true, “shape”: “component”, “fillColor”: “#8AD8F9” “name”: “Libraries”, “regex”: “.*libraries.*$”, “isEnabled”: true, “shape”: “cylinder”, “fillColor”: “#FFACFA” ] and “name”: “Core”, “regex”: “.*core.*$”, “isEnabled”: true, “shape”: “hexagon”, “fillColor”: “#D5625A
Explanation of nodes
/Node name “regex”: “:app$”, “name”: “App”, “name”: “App”, “name”: “App”, “name”: “App”, “name”: “App”, “name”: “App”, /This regex matches the modules that will be drawn as the “isEnabled” node type: true, /Enable or disable the visualization of this node “shape”: “box3d”, / Graphviz node shape: https://graphviz.org/doc/info/shapes.html Graphviz node shape: https://graphviz.org/doc/info/shapes.html Graphviz node shape: https://graphviz.org/doc/info/shapes.html Graphviz node shape: https://graphviz.org/doc/info/ “fillColor”: “#BAFFC9″/These nodes’ hexadecimal color
Copy this basic configuration file to a location in your project that is easily accessible. (The route to the root is ideal)
It’s now time to set up the plugin:
Groovy DSL
nodeTypesPath = “” graphfityExtension (mandatory) Establish the path to your nodeTypes.json projectRootName = “” / graphfityConfig/nodesTypes.json (optional) Consider the following examples: “”:feature:wishlist”, “:app” “GraphImagePath = ” “… is up to you graphImagePath = ” “/(optional)the folder in which your graph.png picture will be saved
DSL in Kotlin
setup nodeTypesPath.set(“”)/ (mandatory) graphfityConfig/nodesTypes.json is an example. provide a path to your nodeTypes.json file projectRootName.set(“”) / (optional) Examples: “:app”, “:feature:wishlist”, etc. graphImagePath.set(“”) /(optional)the folder where your graph.png picture will be put
Usage
When you’ve finished configuring your system, run the following command:
Linux and Mac
graphfity graphfity graphfity graphfity graphfity graphfity graphfity graphfity graph
XP/Vista/XP/Vist
graphfity gradle
The graph will be created in the graphImagePath that was specified in the settings.
Roadmap
A list of suggested features may be found in the open problems (and known issues)
Contributing
Contributions are what make open source such a fantastic environment to learn, inspire, and create. Any help you can provide is highly appreciated.
- Split the Project in Two
- Make a Feature Branch (git checkout -b feature/AmazingFeature) for your project.
- Changes must be committed (git commit -m ‘Add some AmazingFeature’).
- Push to the Branch (AmazingFeature/git push origin feature)
- Publish a Pull Request
GitHub
https://github.com/ivancarras/graphfity
Frequently Asked Questions
How do I add a module as dependency in Gradle?
Gradle has a build script that is called the dependencies section. This is where you can add in your own custom modules, or other projects dependency to your project.
What is Gradle Application Plugin?
Gradle is a build automation system that can be used to automate the building and testing of software projects. It provides a way to describe how software should be built, tested, and packaged.
How do I get all dependencies in Gradle?
To get all dependencies in Gradle, you should add the following to your build.gradle file