3

Is there a way to create images from PlantUML diagrams as part of a gradle build?

I have seen this plugin, however, there is a dependency on Graphviz/Dot and I really need a self-contained build (extract graphviz in a temp dir?) and not one that requires installing extra dependencies before running the build itself.

opticyclic
  • 7,412
  • 12
  • 81
  • 155

1 Answers1

0

A new plugin was created recently by a github user abendt, which doesn't require Graphviz installed.

https://github.com/red-green-coding/plantuml-gradle-plugin

plugins {
    application
    kotlin("jvm") version "1.6.10"
    id("io.github.redgreencoding.plantuml") version "0.2.0"
}

// This will generate diagrams from all files in a "diagrams" directoy.
plantuml {
    diagrams {
        project.fileTree("diagrams").files.forEach { file ->
            create(file.name) {
                sourceFile = project.file(file.path)
            }
        }
    }
}
Lutosław
  • 606
  • 7
  • 24