• Stars
    star
    187
  • Rank 206,464 (Top 5 %)
  • Language
    Groovy
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This plugin adds a new task (graphModules) to your project which will create an image with the graph of your module dependency tree

module-dependency-graph

This gradle plugin adds a task to your project that will create a graph of how your gradle modules depend on each other.

For example, this is the module graph of the Android project GameFrame:

Installation

Apply the gradle plugin on your root build.gradle file:

plugins {
    id 'com.savvasdalkitsis.module-dependency-graph' version '<latest_version>'
}

legacy syntax:

buildscript {
    repositories {
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath "com.savvasdalkitsis:module-dependency-graph:<latest_version>"
    }
}

apply plugin: "com.savvasdalkitsis.module-dependency-graph"

Usage

From the command line, simply run:

./gradlew graphModules

This will create a png of the dependency graph of your modules and open the image

Filtering

You can specify a comma separated list of modules to include in the output. If this is specified the graph will contain only these modules and their dependants and dependencies. This can be helpful when trying to clean up a really complicated dependency tree and you need to focus on only a part of it.

./gradlew graphModules -PgraphFilter=core,presentation:api,network

Specify file locations

You can specify where the dot file and output file get created by specifying the following properties:

./gradlew graphModules -PdotFilePath={ABSOLUTE_PATH_TO_DOT_FILE} -PgraphOutputFilePath={ABSOLUTE_PATH_TO_OUTPUT_FILE}      

or in the gradle.properties file:

dotFilePath={ABSOLUTE_PATH_TO_DOT_FILE}
graphOutputFilePath={ABSOLUTE_PATH_TO_OUTPUT_FILE}

Support for svg and other formats

Apart from png, which is the default format, this plugin has support for other formats, like svg and any other format that graphviz supports (can be found here):

./gradlew graphModules -PgraphOutputFormat=svg      

or in the gradle.properties file:

graphOutputFormat=svg

Auto open output file

By default, the generated graph will be opened using the system's default app for handling the specified format. If you don't want this to happen, you can specify the following parameter:

./gradlew graphModules -PautoOpenGraph=false      

or in the gradle.properties file:

autoOpenGraph=false

Transform dot file

By default, the command line tool dot will be used to transform an output defined in the Gradle property graphOutputFormat. If you don't want this to happen, you can specify the following parameter:

./gradlew graphModules -PtransformDot=false      

or in the gradle.properties file:

transformDot=false

Requirements

You must have graphviz installed on your system in order to use this plugin. For more information on how to install it visit http://www.graphviz.org/

Issues

The plugin currently only works on macOS and Linux since it is in the very early stages (as reflected by its version number). Multi-platform support will be coming soon along with many customization options.

License

Copyright 2020 Savvas Dalkitsis

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

uhuruphotos-android

๐Ÿ–ผ๏ธA modern media gallery, with features like backup/sync, semantic search, media map, face recognition, memories and much more built using the latest Android technologies.
Kotlin
319
star
2

lazy-staggered-grid

A naive Jetpack Compose LazyStaggeredGrid
Kotlin
47
star
3

json-merge

json-merge is a library allowing you to merge two json files for the JVM written in Kotlin
Kotlin
18
star
4

betwixt

Betwixt (/bษชหˆtwษชkst/ - preposition & adverb - archaic term for between) is an android library that aims to provide a unified composable api for animation Interpolators, both provided already by the platform and for new ones provided by the community
Java
15
star
5

bdd-with-gwen

This is a sample project to demonstrate how to write an acceptance test suite using Gwen (https://github.com/shazam/gwen)
Java
11
star
6

gameframe

Animated pixel display by LEDSEQ
Kotlin
9
star
7

Mondo

An open source implementation of a transactions and balance view of a Mondo account (https://getmondo.co.uk)
Java
3
star
8

minecraft-modpack-kevin-nation

Batchfile
1
star
9

minecraft-mod-silencer

A Minecraft mod (Forge) that provides an item that allows you to silence entities.
Kotlin
1
star
10

minecraft-mod-kevin-nation

A mod for the Kevin Nation minecraft community server
Kotlin
1
star
11

smm2-bingo

A Super Mario Maker 2 Bingo site
JavaScript
1
star
12

cv

LaTeX version of my CV
1
star
13

MorseArduino

A simple Arduino program that flashes morse code on the LED of the board
Arduino
1
star
14

Functional-methods-in-OO

This is a task given by the organizers of a talk on functional programming methodologies applied in OO languages like Java.
Java
1
star
15

android-aspects-example

An example on how to use the 'android-aspects' library from Shazam (https://github.com/shazam/android-aspects)
Java
1
star