Graphfity is a Gradle Plugin which creates a dependency node diagram graph about your internal modules dependencies, specially useful if you are developing a multi-module application

Overview

Graphfity creates a dependency nodes diagram graph about your internal modules dependencies, specially useful if you are developing a multi-module application

View Demo · Report Bug · Request Feature



Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

product-image

As a software engineer, you should know how difficult is to maintain a project without a previous initial good architecture. The project scales, new libraries, new features, new dependencies between the internal modules are added...

The purpose of this plugin is help to visualize all the project dependencies between the internal modules, as the projects grows, having of this way a main screenshot of all the features, libraries, core modules, components, or whatever kind of module you want to analise in your project.

Built With

  • Graphviz Graph visualization software
  • Kotlin-DSL An alternative to the traditional Groovy DSL using a modern language as Kotlin
  • Kotlin The natural Java evolution, a modern, concise and save programming language

Getting Started

Prerequisites

Graphviz setup full guide: https://graphviz.org/download/

Mac 🍏

Option #1
sudo port install graphviz
Option #2
brew install graphviz

Windows 🪟

Option #1
winget install graphviz
Option #2
choco install graphviz

Linux 🐧

Option #1
sudo apt install graphviz
Option #2
sudo yum install graphviz
Option #3
sudo apt install graphviz

Installation

Groovy DSL

root build.gradle

plugins {
    id "com.github.ivancarras.graphfity" version "1.0.0"
}

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "com.github.ivancarras:graphfity-plugin:1.0.0"
    }
}

apply plugin: com.github.ivancarras.graphfity.plugin.main.GraphfityPlugin

Kotlin DSL

root build.gradle.kts

plugins {
  id("com.github.ivancarras.graphfity") version "1.0.0"
}
buildscript {
  repositories {
      maven {
          url = uri("https://plugins.gradle.org/m2/")
      }
  }
  dependencies {
      classpath('com.github.ivancarras:graphfity-plugin:1.0.0')
  }
}

apply(plugin = "com.github.ivancarras.graphfity.plugin.main.GraphfityPlugin")

Plugin configuration

The plugin admits 3 configuration properties:

  • nodeTypesPath (mandatory): this is the path for your json node types configuration file (explanation below)
  • projectRootName (optional): start point from the task draws the dependencies, the default value is the ":app" module
  • graphImagePath (optional): path where your graph image will be placed

NodeTypes.json

This is the file used to establish the different nodeTypes of your project a perfect example could be a project divided into:

  • 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": "Component",
    "regex": "^.*component.*$",
    "isEnabled": true ,
    "shape": "component",
    "fillColor": "#8AD8F9"
  },
  {
    "name": "Libraries",
    "regex": "^.*libraries.*$",
    "isEnabled": true,
    "shape": "cylinder",
    "fillColor": "#FFACFA"
  },
  {
    "name": "Core",
    "regex": "^.*core.*$",
    "isEnabled": true,
    "shape": "hexagon",
    "fillColor": "#D5625A"
  }
]

Node explanation

{
"name": "App", //Node name
"regex": "^:app$", //This regex corresponds to the modules which will be draw as this node type
"isEnabled": true, //Enable o disable the visualization of this node
"shape": "box3d", // Graphviz node shape you can choose another one using: https://graphviz.org/doc/info/shapes.html
"fillColor": "#BAFFC9"//Hexadecimal color for these nodes
}

Copy this initial configuration file in an accessible path in your project. (the root path is perfect)

Now is time to configure the plugin:

Groovy DSL

" //(mandatory) Examples: graphfityConfig/nodesTypes.json establish the route to your nodeTypes.json projectRootName = "" //(optional) Examples: ":app", ":feature:wishlist"... is up to you graphImagePath = "" //(optional)the folder where will be placed your graph.png image } ">
graphfityExtension {
  nodeTypesPath = "" //(mandatory) Examples: graphfityConfig/nodesTypes.json establish the route to your nodeTypes.json
  projectRootName = "" //(optional) Examples: ":app", ":feature:wishlist"... is up to you
  graphImagePath = "" //(optional)the folder where will be placed your graph.png image
}

Kotlin DSL

") //(mandatory) Examples: graphfityConfig/nodesTypes.json establish the route to your nodeTypes.json projectRootName.set("") //(optional) Examples: ":app", ":feature:wishlist"... is up to you graphImagePath.set("") //(optional)the folder where will be placed your graph.png image } ">
configure<GraphfityPluginExtension> {
  nodeTypesPath.set("") //(mandatory) Examples: graphfityConfig/nodesTypes.json establish the route to your nodeTypes.json
  projectRootName.set("") //(optional) Examples: ":app", ":feature:wishlist"... is up to you
  graphImagePath.set("") //(optional)the folder where will be placed your graph.png image
}

Usage

When your configuration is done now you can execute:

Mac 🍏 & Linux 🐧

./gradlew graphfity

Windows 🪟

gradle graphfity

The graph is going to be generated in the respective graphImagePath defined in the configuration

Roadmap

See the open issues for a list of proposed features (and known issues)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Apache License. See LICENSE for more information.

Contact

LinkedIn

[email protected]

You might also like...
A Gradle plugin that generates plugin.yml for Bukkit/BungeeCord/Nukkit plugins based on the Gradle project

plugin-yml is a simple Gradle plugin that generates the plugin.yml plugin description file for Bukkit plugins, bungee.yml for Bungee plugins or nukkit.yml for Nukkit plugins based on the Gradle project. Various properties are set automatically (e.g. project name, version or description) and additional properties can be added using a simple DSL.

A Gradle plugin that guards against unintentional dependency changes.
A Gradle plugin that guards against unintentional dependency changes.

🛡️ Dependency Guard A Gradle plugin that helps you guard against unintentional dependency changes. Surface Transitive Dependency Changes Comparison t

A Gradle plugin for generating multi-version packet wrappers for Minecraft: JE

tinyprotocol A Gradle plugin for generating multi-version packet class wrappers for Minecraft: Java Edition. Usage plugins { id("me.kcra.tinyproto

Gradle Plugin that allows you to decompile bytecode compiled with Jetpack Compose Compiler Plugin into Java and check it

decomposer Gradle Plugin that allows you to decompile bytecode compiled with Jetpack Compose Compiler Plugin into Java and check it How to use Run bui

Gradle plugin which analyzes the size of your Android apps

Scope is a Gradle plugin which helps you analyze the size of your Android apps. Motivation App size is an important metric which directly correlates w

A simple gradle plugin that lets you create a download asset from zeplin and convert them to vector drawables automatically
A simple gradle plugin that lets you create a download asset from zeplin and convert them to vector drawables automatically

A simple gradle plugin that lets you create a download asset from zeplin and convert them to vector drawables automatically elephant project using 100% Kotlin and be up and running in a few seconds.

EasyVersion is a Gradle plugin that manage your app or library version.

EasyVersion EasyVersion is a Gradle plugin that manage your app or library version. Before Downloading Create easy_version.json in your root project d

KMP Ready is a Gradle Plugin that provides actionable advice to make your code Kotlin Multiplatform compatible.

KMP Ready IS 🚧 UNDER DEVELOPMENT 🚧 Decisioning Logic Positive Signals ✅ Only Kotlin .kt Source Files Using Kotlin JVM Plugin Uses the Kotlin Multipl

Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms.
Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms.

CompleteKotlin Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms. What this plugin provides This zero-conf

Releases(v1.0.0)
Owner
Iván Carrasco
Android Developer
Iván Carrasco
Gradle plugin which validates the licenses of your dependency graph match what you expect

Gradle plugin which validates the licenses of your dependency graph match what you expect

Cash App 502 Dec 31, 2022
Gradm (Gradle dependencies manager) is a new way to manage dependencies easier and more efficient.

Gradm (Gradle dependencies manager) is a new way to manage dependencies easier and more efficient.

null 16 Jan 9, 2023
Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Dipien 142 Dec 29, 2022
A Gradle Plugin to determine which modules were affected by a set of files in a commit.

A Gradle Plugin to determine which modules were affected by a set of files in a commit. One use case for this plugin is for developers who would like to only run tests in modules which have changed in a given commit.

Dropbox 491 Dec 23, 2022
A Gradle plugin that helps you speed up builds by excluding unnecessary modules.

?? Focus A Gradle plugin that generates module-specific settings.gradle files, allowing you to focus on a specific feature or module without needing t

Dropbox 314 Jan 2, 2023
A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs.

A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs.

Rikka apps 124 Dec 31, 2022
Artifactory is a gradle plugin to assist in developing Minecraft mods that can target different modloaders.

Artifactory Artifactory is a gradle plugin to assist in developing Minecraft mods that can target different modloaders. Currently, Fabric and Forge ar

Zach Kozar 3 Dec 29, 2021
Gradle plugin for adds support for integrating Carthage dependencies into a KMM project

Gradle plugin for adds support for integrating Carthage dependencies into a KMM project

Wire Swiss GmbH 34 Sep 27, 2022
Gradle Plugin that determines if modules are Kotlin Multiplatform (KMP) ready.

Gradle Plugin that determines if modules are Kotlin Multiplatform (KMP) ready. KMP Ready means that the code is Kotlin Multiplatform compatible.

Sam Edwards 58 Dec 22, 2022
Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects

Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects. Former: kotlin-ir-plugin-adapter-gradle

null 2 Mar 8, 2022