This plugin allows you to convert PlantUML (.puml) files into one of the two supported output formats:
- .svg
- .png
The main difference between YAPGP and other PlantUML plugins is that it does not require the PlantUML dependency, instead, it calls a web renderer service to render the PlantUML diagrams and saves them as files.
This plugin is based on https://github.com/red-green-coding/plantuml-gradle-plugin
Using the plugins DSL:
plugins {
id("tech.kocel.yapgp") version "x.y.z"
}
Using legacy plugin application:
buildscript {
repositories {
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
classpath("tech.kocel:yapgp:x.y.z")
}
}
apply(plugin = "tech.kocel.yapgp")
Using the plugins DSL:
plugins {
id "tech.kocel.yapgp" version "x.y.z"
}
Using legacy plugin application:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "tech.kocel:yapgp:x.y.z"
}
}
apply plugin: "tech.kocel.yapgp"
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
}
}