A gradle plugin based on ANTLR to generate UML diagrams from kotlin source code.

Related tags

Build MetaView
Overview

MetaView

A gradle plugin based on ANTLR to generate UML diagrams from kotlin source code.

Install

plugins {
    id "com.xcporter.metaview" version "0.0.5"
}

Configure

generateUml {
//    Add a closure for each chart you'd like to create
    classTree {}
    functionTree {}

//    Each chart can be customized
    classTree {
        //    folder to analyse
        target: File // default: project directory
        
        outputDir: File // default: build directory + docs
        outputFile: String // output file name

        style: List<String> // add valid plantuml skinparams

        // Parent classes/interfaces you'd like to ignore
        // Name with no parenthesis
        ignoreDelegates: List<String>
        
    // Split parameterized types into children when inherited from
    //      useful for mapping projects using kotlin react wrappers      
        splitDelegates: List<String>
    }
    
    functionTree {
        //    folder to analyse
        target: File // default: project directory

        outputDir: File // default: build directory + docs
        outputFile: String // output file name

        style: List<String> // add valid plantuml skinparams
    }
}

Examples

//  Minimum default
generateUml {
    classTree {}
}
//    Select only one submodule from multiplatform project
generateUml {
    classTree {
        outputFile = "common.md"
        target = file(projectDir.path + "/src/commonMain")
    }
    functionTree {
        target = file(projectDir.path + "/src/commonMain")
    }
}
//    Ignore Generic parents in a Kotlin React project
generateUml {
    classTree {
        splitDelegates = ["RComponent"]
        ignoreDelegates = ["RProps", "RState"]
        style = ["skinparam BackgroundColor LightBlue"]
    }
}

Generate Uml

Once you've added some chart closures in your build.gradle file, a task called generateUmlDiagrams will be added to your gradle project under the documentation group.

Charts will be saved in your project's build directory by default, in a folder called 'docs'.

TODO

  • Delegation ignore
  • split type arguments consistently
  • functional hierarchies
  • convert to gradle plugin
  • style input
  • ignore function by kind
  • parse global properties
  • Granular api for including/ignoring objects
  • Java 11 compatability
  • Themes

Sample generated diagram:

example

Under the hood

Most of the heavy lifting is done by ANTLR, which generates parsers in Java based on the kotlin grammar spec

You might also like...

Maven port of the Netflix Gradle code generation plugin for graphql. https://github.com/Netflix/dgs-codegen

This is port of the netflix codegen plugin for Gradle. Found here. COPIED FROM NETFLIX DOCUMENTATION. The DGS Code Generation plugin generates code fo

Dec 24, 2022

Development Driven Testing (DDT) lets you generate unit tests from a running application. Reproduce a bug, generate a properly mocked test

DDTJ: It kills bugs DDT is the flip side of TDD (Test-driven development). It stands for "Development Driven Tests". Notice that it doesn’t contradict

Dec 30, 2021

A web application to generate Java source code with spring-boot and mybatis-plus

A web application to generate Java source code with spring-boot and mybatis-plus

A web application to generate Java source code with spring-boot and mybatis-plus. Also, The class of Domain,Mapper,XML of Mapper Interface,Service,Controller are included. You can change the data source what you want to generate for your project in app running without restart this code -generator application.

Aug 29, 2022

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin

Spark - a tiny web framework for Java 8 Spark 2.9.3 is out!! Changeset dependency groupIdcom.sparkjava/groupId artifactIdspark-core/a

Dec 29, 2022

A MATLAB-like scientific scripting environment for Kotlin, a simpler Kotlin only version of KotlinLab

KotlinLab: Easy and effective MATLAB-like scientific programming with Kotlin and Java JShell Installation The installation of KotlinLab is very simple

Sep 28, 2022

Kotlin-decompiled - (Almost) every single language construct of the Kotlin programming language compiled to JVM bytecode and then decompiled to Java again for better readability

Kotlin: Decompiled (Almost) every single language construct of the Kotlin programming language compiled to JVM bytecode and then decompiled to Java ag

Dec 14, 2022

Java & Kotlin Async DataBase Driver for MySQL and PostgreSQL written in Kotlin

Java & Kotlin Async DataBase Driver for MySQL and PostgreSQL written in Kotlin

jasync-sql is a Simple, Netty based, asynchronous, performant and reliable database drivers for PostgreSQL and MySQL written in Kotlin. Show your ❤ wi

Dec 31, 2022

From Java To Kotlin - Your Cheat Sheet For Java To Kotlin

From Java To Kotlin - Your Cheat Sheet For Java To Kotlin

From Java To Kotlin From Java To Kotlin - Your Cheat Sheet For Java To Kotlin 中文支持 Português Español Print to Console Java System.out.print("Amit Shek

Dec 29, 2022

An object mapping jetbrains plugin, it will automatically generate the get/set code between the two objects.

BeanMappingKey 简体中文 | English 一键生成两个实体类之间的字段映射代码,用于代替 BeanUtil 与 MapStruct 等工具。 使用指南 在 Java 开发的过程中,经常会使用众多包装型的对象如:BO、VO、DTO,它们之间往往只有两三个字段的差异, 而对它们进行相互

Dec 14, 2022

The open-source Java obfuscation tool working with Ant and Gradle by yWorks - the diagramming experts

The open-source Java obfuscation tool working with Ant and Gradle by yWorks - the diagramming experts

yGuard yGuard is an open-source Java obfuscation tool. With yGuard it is easy as pie ( 🍰 ) to configure obfuscation through an extensive ant task. yG

Jan 2, 2023

:package: Gradle/Maven plugin to package Java applications as native Windows, Mac OS X, or GNU/Linux executables and create installers for them.

JavaPackager JavaPackager is a hybrid plugin for Maven and Gradle which provides an easy way to package Java applications in native Windows, Mac OS X

Jan 8, 2023

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

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

Jan 5, 2023

A gradle plugin for developing javaagent applications.

Javaagent Packing A gradle plugin for developing javaagent applications. Why this plugin Fast packing all dependencies Used many dependencies? Javaage

May 13, 2022

Houston Asset Server Gradle plugin

Houston Asset Server Gradle plugin It is a helper that helps achieve synchronization automation through the build script of the schema serialized in p

Jan 28, 2022

A gradle plugin generates resConfig & languages array from project res folder.

For Android application projects that accept user-submitted translations, the number of supported languages may be large and growing. When new languages are added, developers need to manually update resConfig (1) and language array xml/class (2). Manual means there could be human error.

Nov 12, 2022

Java Ecosystem Capabilities Gradle Plugin

Java Ecosystem Capabilities Gradle Plugin

Java Ecosystem Capabilities Gradle Plugin This plugin adds Capabilities to the metadata of well-known components hosted on Maven Central that are used

Dec 6, 2022

Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml

manifest-guard Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml The problem being solved Every third-par

Dec 24, 2022

Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based system

FRC 2022 Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based s

Oct 4, 2022
Comments
  • Problem with Java Runtime (class file version)

    Problem with Java Runtime (class file version)

    Hello, this is a great project, it saves a lot of documentation time. But after I upgraded my Kotlin to 1.5 I have the following error:

    > Task :generateUmlDiagrams FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':generateUmlDiagrams'.
    > com/xcporter/KotlinLexer has been compiled by a more recent version of the Java Runtime 
    (class file version 58.0), this version of the Java Runtime only recognizes class file versions up to 55.0
    

    I'm quite new to Kotlin, so I don't know what this error means. What can e do to solve it?

    Thanks.

    opened by evandroabukamel 4
  • Package separation

    Package separation

    Hello,

    First of all, thanks for this awesome plugin. After using it, I noticed that I have every classes in my class diagram but it could be great if we could have the opportunity to also have a package separation.

    Could it be possible to add it ?

    opened by brakzog 1
  • Objects in sealed class are not generated

    Objects in sealed class are not generated

    Thanks for awesome tool. Sealed class:

    @Serializable
    sealed class ErrorDTO {
    
       @Serializable
       @SerialName(Reason.WRONG_LOGIN_LENGTH)
       data class WrongLoginLength(
          @SerialName("count") val count: Int,
          @SerialName("minCount") val minCount: Int,
          @SerialName("maxCount") val maxCount: Int
       ) : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.RUNTIME_EXCEPTION)
       data class UnknownException(
          @SerialName("message") val message: String? = null
       ) : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.USER_NOT_FOUND)
       object UserNotFound : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.FILE_NOT_FOUND)
       object FileNotFound : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.WHO_AND_TO_ARE_SAME)
       object WhoAndToAreSame : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.UNAUTHORIZED)
       object UnAuthorize : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.INVALID_EMAIL)
       object InvalidEmail : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.EMPTY_PASSWORD)
       object EmptyPassword : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.PASSWORDS_NOT_MATCH)
       object PasswordsNotMatch : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.USER_WITH_THAT_LOGIN_ALREADY_EXIST)
       object UserWithThatLoginAlreadyExists : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.OPERATION_NOT_PERMITTED)
       object OperationNotPermitted : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.CONTENT_NOT_FOUND)
       object ContentNotFound : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.LESSON_NOT_FOUND)
       object LessonNotFound : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.COURSE_NOT_FOUND)
       object CourseNotFound : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.GROUP_NOT_FOUND)
       object GroupNotFound : ErrorDTO()
    
       @Serializable
       @SerialName(Reason.SUBSCRIPTION_NOT_FOUND)
       object SubscriptionNotFound : ErrorDTO()
    
    }
    

    Generated diagram: image

    opened by yandroidUA 2
Owner
Alex Porter
Musician/Composer/Programmer living in Manahttan
Alex Porter
IzPack - Source Code

IzPack IzPack is a widely used tool for packaging applications on the Java platform as cross-platform installers. License IzPack is published under th

IzPack 297 Jan 5, 2023
Jenkins plugin exposes functionalities for the Popcorn by Lectra open-source Jenkins platform on Kubernetes

Popcorn Jenkins Plugin This Jenkins plugin exposes functionalities for the Popcorn by Lectra open-source Jenkins platform on Kubernetes. This plugin i

Lectra 4 Apr 6, 2022
A Maven plugin which fixes Scala dependencies incompatible with Java 9+

scala-suffix Maven Plugin A Maven plugin which fixes Scala dependencies incompatible with Java 9+. A bit of context First of all, you need this plugin

Maciej Gorywoda 7 Jan 5, 2022
Diagrams as code is a term used for storing the source of a diagram image as a text file.

Diagrams as code Diagrams as code is a term used for storing the source of a diagram image as a text file. Examples are architecture diagrams, or diag

null 26 Nov 21, 2022
Spotless-intellij-gradle - An IntelliJ plugin to allow running the Spotless gradle task from within the IDE.

Spotless Intellij Gradle An IntelliJ plugin to allow running the spotless gradle task from within the IDE on the current file selected in the editor.

Ryan Gurney 30 Dec 17, 2022
cglib - Byte Code Generation Library is high level API to generate and transform Java byte code. It is used by AOP, testing, data access frameworks to generate dynamic proxy objects and intercept field access.

cglib Byte Code Generation Library is high level API to generate and transform JAVA byte code. It is used by AOP, testing, data access frameworks to g

Code Generation Library 4.5k Jan 8, 2023
Exercico com Junit 5, UML, Interação de classes e Exception

AcessoClube Exercico com Junit 5, UML, Interação de classes e Exception Exercicio: Projete e desenvolva um sistema de controle de acesso a um clube co

Mateus Samartini 3 May 3, 2021
ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

ANTLR v4 Build status ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating

Antlr Project 13.6k Dec 28, 2022
A library for creating and editing graph-like diagrams in JavaFX.

Graph Editor A library for creating and editing graph-like diagrams in JavaFX. This project is a fork of tesis-dynaware/graph-editor 1.3.1, which is n

Steffen 125 Jan 1, 2023
ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

ANTLR v4 Build status ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating

Antlr Project 13.6k Jan 3, 2023