Skip to content
/ yapgp Public

Yet Another PlantUML Gradle Plugin (YAPGP)

License

Notifications You must be signed in to change notification settings

kkocel/yapgp

Repository files navigation

YAPGP - Yet Another PlantUML Gradle Plugin

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

Adding the plugin

Kotlin

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")

Groovy

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"

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

Yet Another PlantUML Gradle Plugin (YAPGP)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages