homebrew-core/Formula/closure-compiler.rb
ilovezfs 6cdbe93ed0 closure-compiler 20161201
use maven jar
set bottle :unneeded

Closes #7622.

Signed-off-by: Tomasz Pajor <tomek@polishgeeks.com>
2016-12-07 12:31:50 +01:00

28 lines
853 B
Ruby

class ClosureCompiler < Formula
desc "JavaScript optimizing compiler"
homepage "https://github.com/google/closure-compiler"
url "https://search.maven.org/remotecontent?filepath=com/google/javascript/closure-compiler/v20161201/closure-compiler-v20161201.jar"
sha256 "21c9b26ac57e00944804a902958542520d04da5b5bffd0db553b83a20d0a608e"
bottle :unneeded
depends_on :java => "1.7+"
def install
libexec.install Dir["*"]
bin.write_jar_script libexec.children.first, "closure-compiler"
end
test do
(testpath/"test.js").write <<-EOS.undent
(function(){
var t = true;
return t;
})();
EOS
system bin/"closure-compiler",
"--js", testpath/"test.js",
"--js_output_file", testpath/"out.js"
assert_equal (testpath/"out.js").read.chomp, "(function(){return!0})();"
end
end