homebrew-core/Formula/checkstyle.rb

22 lines
714 B
Ruby
Raw Normal View History

require 'formula'
class Checkstyle < Formula
homepage 'http://checkstyle.sourceforge.net/'
url 'http://downloads.sourceforge.net/project/checkstyle/checkstyle/5.6/checkstyle-5.6-bin.tar.gz'
sha1 'cf08ac75aedddcd3a8d1f27fcbbb6095b0d1d5e3'
def install
2013-08-12 23:47:38 +00:00
libexec.install "checkstyle-#{version}-all.jar", "sun_checks.xml"
bin.write_jar_script libexec/"checkstyle-#{version}-all.jar", "checkstyle"
end
2013-02-02 05:12:31 +00:00
test do
2012-08-07 18:20:52 +00:00
# Note this test "fails" because the audit has issues
# TODO - pipe through cat to ingore error code
2013-02-02 05:12:31 +00:00
(testpath/"Test.java").write <<-EOS.undent
2012-05-02 02:43:45 +00:00
public class Test{ }
2013-02-02 05:12:31 +00:00
EOS
system "#{bin}/checkstyle", "-c", "#{libexec}/sun_checks.xml", "-r", "Test.java"
end
end