2015-07-06 06:01:22 +00:00
|
|
|
class CfrDecompiler < Formula
|
|
|
|
desc "Yet Another Java Decompiler."
|
|
|
|
homepage "http://www.benf.org/other/cfr/"
|
2015-11-08 06:44:03 +00:00
|
|
|
url "http://www.benf.org/other/cfr/cfr_0_108.jar"
|
|
|
|
sha256 "d1698d9d454f1963468d7cb0302e4ef5fddc5bd8af077024c64c13b8b7331c2c"
|
2015-07-06 06:01:22 +00:00
|
|
|
|
2015-10-23 08:38:27 +00:00
|
|
|
bottle :unneeded
|
|
|
|
|
2015-07-06 06:01:22 +00:00
|
|
|
depends_on :java => "1.6+"
|
|
|
|
|
|
|
|
def install
|
2015-08-09 04:16:34 +00:00
|
|
|
jar_version = version.to_s.tr(".", "_")
|
2015-07-06 06:01:22 +00:00
|
|
|
libexec.install "cfr_#{jar_version}.jar"
|
|
|
|
bin.write_jar_script libexec/"cfr_#{jar_version}.jar", "cfr-decompiler"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
fixture = <<-EOS.undent
|
|
|
|
import java.io.PrintStream;
|
|
|
|
|
|
|
|
class T {
|
|
|
|
T() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void main(String[] arrstring) {
|
|
|
|
System.out.println("Hello brew!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
(testpath/"T.java").write fixture
|
|
|
|
system "javac", "T.java"
|
|
|
|
output = pipe_output("#{bin}/cfr-decompiler T.class")
|
2015-08-09 04:16:34 +00:00
|
|
|
assert_match fixture, output
|
2015-07-06 06:01:22 +00:00
|
|
|
end
|
|
|
|
end
|