Git Product home page Git Product logo

gradle-visteg's Introduction

Gradle VisTEG

Overview

VisTeg is a Gradle plugin for exporting task execution graph as .dot file.

Configuration

Apply visteg plugin

Gradle 1.x and 2.0

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'cz.malohlava:visteg:1.0.3'
    }
}

apply plugin: 'cz.malohlava.visteg'

Gradle 2.1 and higher

plugins {
  id 'cz.malohlava.visteg' version '1.0.3'
}

Configure graph generator

The plugin publishes visteg extension with following configuration options:

visteg {
    enabled        = true
    colouredNodes  = true
    colouredEdges  = true
    destination    = 'build/reports/visteg.dot'
    exporter       = 'dot'
    colorscheme    = 'spectral11'
    nodeShape      = 'box'
    startNodeShape = 'hexagon'
    endNodeShape   = 'doubleoctagon'
}

The plugin supports the following options:
  • enabled - Enables plugin for the project.
  • colouredNodes - Produces colored nodes.
  • colouredEdges - Produces colored edges.
  • destination - The output file location.
  • exporter - Name of graph exporter, only dot value is supported now.
  • colorscheme - Name of color scheme used for graph coloring. For full list of values see Graphviz page.
  • nodeShape - Name of shape used for graph inner nodes. See Graphviz page for full list of values.
  • startNodeShape - Name of shape used for graph start nodes. See Graphviz page for full list of values.
  • endNodeShape - Name of shape used for graph leaf nodes. See Graphviz page for full list of values.

Graph generation

Perform any Gradle task, for example build:

./gradlew build

It will generate a .dot file containing graph description build/reports/visteg.dot.

Image generation

The generated file can be post-processed via Graphviz dot utility.

For example, png image is produced as follows:

cd build/reports/
dot -Tpng ./visteg.dot -o ./visteg.dot.png

For more information, please visit Graphviz home page.

Design

The plugin installs itself as a listener to Gradle lifecycle via gradle.taskGraph.whenReady. During execution it obtains reference to task execution graph via reflection and performs a walk through the graph.

Acknowledgements

Based on idea published by Code Wader - http://codewader.blogspot.com/2011/11/show-gradle-dependencies-as-graphwiz.html

gradle-visteg's People

Contributors

leonard84 avatar mmalohlava avatar ncalexan avatar

Watchers

 avatar  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.