Skip to content

red-green-coding/plantuml-gradle-plugin

Repository files navigation

plantuml-gradle-plugin

This plugin allows you to convert PlantUML (.puml) files into one of the supported output formats:

Adding the plugin

Kotlin

Using the plugins DSL:

plugins {
    id("io.github.redgreencoding.plantuml") version "x.y.z"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("io.github.redgreencoding:plantuml-gradle-plugin:x.y.z")
  }
}

apply(plugin = "io.github.redgreencoding.plantuml")

Groovy

Using the plugins DSL:

plugins {
    id "io.github.redgreencoding.plantuml" version "x.y.z"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "io.github.redgreencoding:plantuml-gradle-plugin:x.y.z"
  }
}

apply plugin: "io.github.redgreencoding.plantuml"

Plugin usage

After adding the plugin to your build you can configure the plugin using the extension block plantuml

Check the supported output formats here.

Kotlin

plantuml {
    options {
        // where should the .svg be generated to (defaults to build/plantuml)
        outputDir = project.file("svg")
        
        // output format (lowercase, defaults to svg)
        format = "svg"
    }

    diagrams {
        create("File1") {
            // .puml sourcefile, this can be also omitted and defaults to _<name>.puml_.
            sourceFile = project.file("doc/File1.puml")
        }

        // this will just look for the file File2.puml
        create("File2")

        // add additional files here
    }
}

Groovy

plantuml {
    options {
        // where should the .svg be generated to (defaults to build/plantuml)
        outputDir = project.file("svg")

        // output format (lowercase, defaults to svg)
        format = "svg"
    }

    diagrams {
        File1 {
            // .puml sourcefile, this can be also omitted and defaults to _<name>.puml_.
            sourceFile = project.file("doc/File1.puml")
        }

        // this will just look for the file File2.puml
        File2

        // add additional files here
    }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages