This plugin allows you to convert PlantUML (.puml) files into one of the supported output formats:
- .svg
- .png
- ... (check here for all supported formats of the underlying PlantUML library library)
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")
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"
After adding the plugin to your build you can configure the plugin using the extension block plantuml
Check the supported output formats here.
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
}
}
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
}
}