2012-04-30 09:37:34 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Checkstyle < Formula
|
|
|
|
homepage 'http://checkstyle.sourceforge.net/'
|
2012-11-12 20:59:36 +00:00
|
|
|
url 'http://sourceforge.net/projects/checkstyle/files/checkstyle/5.6/checkstyle-5.6-bin.tar.gz'
|
|
|
|
sha1 'cf08ac75aedddcd3a8d1f27fcbbb6095b0d1d5e3'
|
2012-04-30 09:37:34 +00:00
|
|
|
|
|
|
|
def install
|
2012-11-12 20:59:36 +00:00
|
|
|
libexec.install 'checkstyle-5.6-all.jar', 'sun_checks.xml'
|
|
|
|
bin.write_jar_script libexec/'checkstyle-5.6-all.jar', 'checkstyle'
|
2012-04-30 09:37:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def test
|
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
|
2012-04-30 09:37:34 +00:00
|
|
|
mktemp do
|
2012-05-02 02:43:45 +00:00
|
|
|
# create test file
|
2012-04-30 09:37:34 +00:00
|
|
|
(Pathname.pwd/"Test.java").write <<-EOS.undent
|
2012-05-02 02:43:45 +00:00
|
|
|
public class Test{ }
|
2012-04-30 09:37:34 +00:00
|
|
|
EOS
|
2012-05-15 21:36:45 +00:00
|
|
|
system "#{bin}/checkstyle", "-c", "#{libexec}/sun_checks.xml", "-r", "Test.java"
|
2012-04-30 09:37:34 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|