aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/closure-compiler.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Formula/closure-compiler.rb b/Library/Formula/closure-compiler.rb
index 1bbe9d02c..ba597669f 100644
--- a/Library/Formula/closure-compiler.rb
+++ b/Library/Formula/closure-compiler.rb
@@ -1,5 +1,17 @@
require 'formula'
+class Java7 < Requirement
+ fatal true
+
+ def satisfied?
+ `java -version`.split("\n")[0] =~ /"1\.7/
+ end
+
+ def message
+ "Java 7 is required."
+ end
+end
+
class ClosureCompiler < Formula
homepage 'http://code.google.com/p/closure-compiler/'
url 'https://code.google.com/p/closure-compiler/', :using => :git, :tag => 'v20140303'
@@ -7,6 +19,7 @@ class ClosureCompiler < Formula
head 'https://code.google.com/p/closure-compiler/', :using => :git
depends_on :ant
+ depends_on Java7
def install
system "ant", "clean"