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://github.com/plantuml/plantuml/releases/download/v1.2022.13/plantuml-1.2022.13.jar"
|
|
sha256 "dd54cde638aad75aafdbaa7a28dca0dc6bb4dcba8cacce5c810572c5e5d2a522"
|
|
license "GPL-3.0-or-later"
|
|
version_scheme 1
|
|
|
|
livecheck do
|
|
url :stable
|
|
strategy :github_latest
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "934413f4923dc4c51997f139abe6fce343babc7e13eea2e9a57b5660adbf0d55"
|
|
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
|