aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorLeonard Ehrenfried2012-04-30 11:37:34 +0200
committerAdam Vandenberg2012-05-01 19:41:33 -0700
commit7c4af403d04b069061bdca64ab071a65506c3ec9 (patch)
treecc07475a26b17045e7634079c66d75d356ca9ebe /Library/Formula
parentc790674501acfbec96bc0d98ae3fed4ef624c5b1 (diff)
downloadhomebrew-7c4af403d04b069061bdca64ab071a65506c3ec9.tar.bz2
Checkstyle 5.5
Checkstyle is a Java program that audits source files according to style rules. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/checkstyle.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/Library/Formula/checkstyle.rb b/Library/Formula/checkstyle.rb
new file mode 100644
index 000000000..3ab890de7
--- /dev/null
+++ b/Library/Formula/checkstyle.rb
@@ -0,0 +1,28 @@
+require 'formula'
+
+class Checkstyle < Formula
+ homepage 'http://checkstyle.sourceforge.net/'
+ url 'http://sourceforge.net/projects/checkstyle/files/checkstyle/5.5/checkstyle-5.5-bin.tar.gz'
+ md5 '0dd29971aa26d917d88c229182272056'
+
+ def install
+ # wrapper script
+ (bin/'checkstyle').write <<-EOS.undent
+ #! /usr/bin/env bash -e
+ java -jar "#{libexec}/checkstyle-5.5-all.jar" "$@"
+ EOS
+
+ libexec.install 'checkstyle-5.5-all.jar', 'sun_checks.xml'
+ end
+
+ def test
+ mktemp do
+ # create test file for `brew test checkstyle`
+ (Pathname.pwd/"Test.java").write <<-EOS.undent
+ public class Test{
+ }
+ EOS
+ system "#{bin}/checkstyle -c #{libexec}/sun_checks.xml -r Test.java"
+ end
+ end
+end