Skip to content

Latest commit

 

History

History
135 lines (92 loc) · 3.5 KB

README.adoc

File metadata and controls

135 lines (92 loc) · 3.5 KB

ArchiDoc Gradle Plugin

Documenting Software Architecture Plugin

Visualizing code of your application. It generates full diagram of your classes in .dot(graphviz) file.

Plugin is based on work - Classgraph You can open the generated dot file in a vector editor. You can convert then the model into The Standard for exchange of architecture models from The Open Group

Plugin uses all jars in runtimeClasspath configuration and also main source set build folder (there for the task depends on 'build' task) Scans both project and subprojects

Plugin avialable at gradle plugin portal

Project for testing athttps://github.com/wilmerkrisp/archidoc-test[gitlab]

For using plugin in gradle

configure plugin in build.gradle, select whrere to put file and your programm packages for analysis.

plugins {
    id 'life.expert.archidoc' version '1.0.10'
    }

project.tasks.getByName("archidoc").dependsOn 'build'

archidoc { file "$buildDir/architecture/classdiagram.dot" packages = ['com.my'] enableAllInfo() }

run task archidoc

 ./gradlew arhidoc

Also plugin options avialable:

multiProject()          //if you want analyze also gradle subprojects, please build all subprojects because the task doesnot depend on subprojects build-tasks

Also Classgraph options avialable:

    verbose()           // print all log messages
    enableAllInfo()    //  all information about classes
    enableFieldInfo()
    enableMethodInfo()
    ignoreFieldVisibility()
    ignoreMethodVisibility()
    enableClassInfo()
    enableAnnotationInfo()
    ignoreClassVisibility()
    enableInterClassDependencies()
    enableExternalClasses()

Configuration for multiproject build:

project.tasks.getByName("archidoc").dependsOn 'build',**':subproject:build'**
archidoc {
    file "$buildDir/architecture/classdiagram.dot"
    packages = ['com.my', 'org.your']
    **multiProject()**
    enableAllInfo()
    verbose()
}

how to instantly get .PNG file

plugins {
    id "life.expert.archidoc" version "1.0.10"
    id "com.simonharrer.graphviz" version "0.0.1" // thanks to https://github.com/simonharrer/gradle-graphviz-plugin
}

archidoc {
    //Sorry. For "graphviz plugin" No configuration possible.
    //It just converts your **src/main/graphviz/**.dot to build/graphviz/.png.
    file "${project.projectDir}/src/main/graphviz/classdiagram.dot"
    packages = ['org' ]
    enableAllInfo()
}

graphviz.dependsOn(archidoc)

howtouse

resultimagexample

what about 'really' architecture

Programming is an art. What does a framework look like? Below is a hierarchical class diagram for the google Truth framework (about 600 items!). Obtained by using the archidoc plug-in. OmniGraffle was used to convert dot→png.

ntruth600 hierarh plus

For inter class dependencies

Includes class references in local variables or intermediate values
 archidoc {
     file  "$buildDir/architecture/classdiagram.dot"
     packages = ['com.my']
     enableAllInfo()
       enableInterClassDependencies()
         enableExternalClasses()
 }
Here is the simpliest example

example1 example2

Here is example with enableExternalClasses

example3