42 lines
1.3 KiB
Ruby
42 lines
1.3 KiB
Ruby
class Proguard < Formula
|
|
desc "Java class file shrinker, optimizer, and obfuscator"
|
|
homepage "https://www.guardsquare.com/en/products/proguard"
|
|
url "https://github.com/Guardsquare/proguard/releases/download/v7.2.2/proguard-7.2.2.tar.gz"
|
|
sha256 "4c7c7c6bdf22e26ec40642c5b4b1cadd55848827de5ec91ff6eb7fbe96b38e8f"
|
|
license "GPL-2.0-or-later"
|
|
|
|
livecheck do
|
|
url :stable
|
|
strategy :github_latest
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "8f937fd1c7da304cd437ae5b14bc11987433634d27b08afcdd83b621e8d75f98"
|
|
end
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
libexec.install "lib/proguard.jar"
|
|
libexec.install "lib/proguardgui.jar"
|
|
libexec.install "lib/retrace.jar"
|
|
bin.write_jar_script libexec/"proguard.jar", "proguard"
|
|
bin.write_jar_script libexec/"proguardgui.jar", "proguardgui"
|
|
bin.write_jar_script libexec/"retrace.jar", "retrace"
|
|
end
|
|
|
|
test do
|
|
expect = <<~EOS
|
|
ProGuard, version #{version}
|
|
Usage: java proguard.ProGuard [options ...]
|
|
EOS
|
|
assert_equal expect, shell_output("#{bin}/proguard", 1)
|
|
|
|
expect = <<~EOS
|
|
Picked up _JAVA_OPTIONS: #{ENV["_JAVA_OPTIONS"]}
|
|
Usage: java proguard.retrace.ReTrace [-regex <regex>] [-allclassnames] [-verbose] <mapping_file> [<stacktrace_file>]
|
|
EOS
|
|
assert_match expect, pipe_output("#{bin}/retrace 2>&1")
|
|
end
|
|
end
|