homebrew-core/Formula/plantuml.rb
Dominyk Tiller bb30d0b533
plantuml 1.2018.10
Closes #31470.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2018-08-25 21:21:34 +01:00

34 lines
1,014 B
Ruby

class Plantuml < Formula
desc "Draw UML diagrams"
homepage "https://plantuml.com/"
url "https://downloads.sourceforge.net/project/plantuml/1.2018.10/plantuml.1.2018.10.jar"
sha256 "5aae4028f4d301466490bb81cd32e0b1c206a6d3c76836bdb3088d985dfe43a7"
version_scheme 1
bottle :unneeded
option "with-pdf-support", "Downloads additional JAR files for PDF export functionality"
depends_on "graphviz"
depends_on :java
resource "batik-and-fop" do
url "http://beta.plantuml.net/batikAndFop.zip"
sha256 "c1f328a9aacfd954c6cd90650cefd924baea358d6e27520de7ccf9b30a681877"
end
def install
jar = "plantuml.jar"
libexec.install "plantuml.#{version}.jar" => jar
(bin/"plantuml").write <<~EOS
#!/bin/bash
GRAPHVIZ_DOT="#{Formula["graphviz"].opt_bin}/dot" exec java -jar #{libexec}/#{jar} "$@"
EOS
chmod 0555, bin/"plantuml"
libexec.install resource("batik-and-fop") if build.with? "pdf-support"
end
test do
system bin/"plantuml", "-testdot"
end
end