From 3179e6d69e3ee8973327d6f0eea5d47c998dcba4 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Tue, 8 Apr 2014 20:39:28 -0700 Subject: [PATCH] closure-compiler: requires Java 7 Closes Homebrew/homebrew#27938. --- Formula/closure-compiler.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Formula/closure-compiler.rb b/Formula/closure-compiler.rb index 1bbe9d02c7..ba597669f8 100644 --- a/Formula/closure-compiler.rb +++ b/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"