38 lines
1.0 KiB
Ruby
38 lines
1.0 KiB
Ruby
class Plantuml < Formula
|
|
desc "Draw UML diagrams"
|
|
homepage "https://plantuml.com/"
|
|
url "https://downloads.sourceforge.net/project/plantuml/1.2022.8/plantuml.1.2022.8.jar"
|
|
sha256 "9e8472b15e9deef57f57a49db1548d777d7a9fd87c0c02f27c383af260a89e53"
|
|
license "GPL-3.0-or-later"
|
|
version_scheme 1
|
|
|
|
livecheck do
|
|
url :stable
|
|
regex(%r{url=.*?/plantuml[._-]v?(\d+(?:\.\d+)+)\.t}i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "125f4eb600ef42568d9ffcdf21ee66daaedb07011384e1a35cbc74729b714f94"
|
|
end
|
|
|
|
depends_on "graphviz"
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
jar = "plantuml.jar"
|
|
libexec.install "plantuml.#{version}.jar" => jar
|
|
(bin/"plantuml").write <<~EOS
|
|
#!/bin/bash
|
|
if [[ "$*" != *"-gui"* ]]; then
|
|
VMARGS="-Djava.awt.headless=true"
|
|
fi
|
|
GRAPHVIZ_DOT="#{Formula["graphviz"].opt_bin}/dot" exec "#{Formula["openjdk"].opt_bin}/java" $VMARGS -jar #{libexec}/#{jar} "$@"
|
|
EOS
|
|
chmod 0755, bin/"plantuml"
|
|
end
|
|
|
|
test do
|
|
system bin/"plantuml", "-testdot"
|
|
end
|
|
end
|