aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorChris Smola2014-03-24 21:54:25 -0600
committerMike McQuaid2014-03-29 09:06:17 -0500
commit9a3a150fc9e1cda490ce86b1ecee4a9567111c9e (patch)
tree634342daeba96d8c8740b39a7d2eec80ea20ae5c /Library
parent00033a1306ec558b27ff7defc3b804a4b3cfa76d (diff)
downloadhomebrew-9a3a150fc9e1cda490ce86b1ecee4a9567111c9e.tar.bz2
pmd 5.1.0
The compiled jars and documentation for PMD 5.1.0. Closes #27841. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/pmd.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/Library/Formula/pmd.rb b/Library/Formula/pmd.rb
new file mode 100644
index 000000000..6d68c2dcf
--- /dev/null
+++ b/Library/Formula/pmd.rb
@@ -0,0 +1,38 @@
+require "formula"
+
+class Pmd < Formula
+ homepage "http://pmd.sourceforge.net/"
+ url "https://downloads.sourceforge.net/project/pmd/pmd/5.1.0/pmd-src-5.1.0.zip"
+ sha1 "5dff0c4ca2853c464ce4634079809bdf54918923"
+
+ def install
+ rm Dir["bin/*.{bat,cmd,dll,exe}"]
+ libexec.install Dir["*"]
+ bin.install_symlink "#{libexec}/bin/run.sh" => "pmd"
+
+ # the run script references paths which don't account for the
+ # file structure of this brew.
+ inreplace "#{libexec}/bin/run.sh", "/../lib", "/../libexec/lib"
+ end
+
+ def caveats; <<-EOS.undent
+ Use `pmd` instead of run.sh as described in the official documentation.
+ EOS
+ end
+
+ test do
+ (testpath/"java/testClass.java").write <<-EOS.undent
+ public class BrewTestClass {
+ // dummy constant
+ public String SOME_CONST = "foo";
+
+ public boolean doTest () {
+ return true;
+ }
+ }
+ EOS
+
+ system "#{bin}/pmd", "pmd", "-d", "#{testpath}/java", "-R",
+ "rulesets/java/basic.xml", "-f", "textcolor", "-l", "java"
+ end
+end