Code Monkey home page Code Monkey logo

module-graph's Introduction

Pre Merge Checks License Language

Introducing the Gradle Module Graph Plugin! ๐ŸŒŸ

This plugin generates a Mermaid graph for your Gradle project, providing a visual representation of your project's module relationships. By illustrating the connections between modules, it makes it easier to grasp your project's structure and interdependencies.

A diagram about the current system is only useful if it's generated. If it is produced by hand it documents the author's belief, not the system. Still, important, but not an input for decision making. Development is primarily decision making. Enable it through custom tools. source

You can read more about the background story of this plugin here.

Features

  • Generate a Mermaid dependency graph of the modules in your Gradle project
  • Automatically append the generated graph to your project's README file

Getting Started

You'll just need to add it to your project's root build.gradle or build.gradle.kts file.

build.gradle (Groovy DSL)

Using the plugins DSL

plugins {
  id "dev.iurysouza.modulegraph" version "0.2.2"
}
buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "dev.iurysouza:modulegraph:0.2.2"
  }
}

apply plugin: "dev.iurysouza.modulegraph"

Configuring the plugin

  moduleGraphConfig {
      readmePath = '$projectDir/README.md'
      heading = '### Dependency Diagram'
      theme = Theme.NEUTRAL
  }

build.gradle.kts (Kotlin DSL)

Using the plugins DSL

plugins {
  id("dev.iurysouza.modulegraph") version "0.2.2"
}
buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("dev.iurysouza:modulegraph:0.2.2")
  }
}

apply(plugin = "dev.iurysouza:modulegraph")

Configuring the plugin

moduleGraphConfig {
    readmePath.set("$projectDir/README.md")
    heading.set("### Dependency Diagram")
    theme.set(Theme.NEUTRAL)
}

Configuration

To configure the Gradle Module Dependency Graph Plugin, you can set the following options:

  • readmePath: The path of the file where the dependency graph will be appended.
  • theme: The mermaid theme to be used for styling the graph. Default is NEUTRAL.
  • heading: The heading where the dependency graph will be appended.

Usage

To generate the Mermaid dependency graph for your project, run the following command:

./gradlew createModuleGraph

Example Diagram

You can expect the plugin to generate this kind of diagram after running the plugin:

%%{
  init: {
    'theme': 'neutral'
  }
}%%

graph LR
  subgraph app
    main
    playground
  end
  subgraph core
    common
    design-system
    footballdata
    reddit
  end
  subgraph features
    match-day
    match-thread
  end
  main --> match-thread
  main --> match-day
  main --> footballdata
  main --> reddit
  main --> design-system
  main --> common
  playground --> match-thread
  playground --> match-day
  playground --> footballdata
  playground --> reddit
  playground --> design-system
  playground --> common
  footballdata --> common
  reddit --> common
  match-day --> common
  match-day --> footballdata
  match-day --> design-system
  match-day --> reddit
  match-thread --> common
  match-thread --> footballdata
  match-thread --> design-system
  match-thread --> reddit
Loading

Contributing ๐Ÿค

Feel free to open an issue or submit a pull request for any bugs/improvements.

License ๐Ÿ“„

This template is licensed under the MIT License - see the License file for details.

module-graph's People

Contributors

iurysza avatar stylianosgakis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.