2011-03-10 05:11:03 +00:00
|
|
|
class ClosureCompiler < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "JavaScript optimizing compiler"
|
2014-07-24 23:04:59 +00:00
|
|
|
homepage "https://github.com/google/closure-compiler"
|
2015-08-10 04:29:23 +00:00
|
|
|
url "https://github.com/google/closure-compiler/archive/maven-release-v20150729.tar.gz"
|
|
|
|
sha256 "6564bd642e25154da0364f964deb02710a3952066954fe082bacd0b85d965d54"
|
2014-07-24 23:04:59 +00:00
|
|
|
head "https://github.com/google/closure-compiler.git"
|
2010-10-17 00:15:37 +00:00
|
|
|
|
2014-11-02 11:54:34 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-08-10 05:38:40 +00:00
|
|
|
sha256 "904cc70d5bf207b8e0306b7e2ccbbfbf91732e6ac1ee0f7d55c15e8a45d79644" => :yosemite
|
|
|
|
sha256 "a7e8f3502ce9d1604d75ae1af6293caf8c888d5185d060ae88fdab8cbbc32f94" => :mavericks
|
|
|
|
sha256 "34ab6fa29a3c22ec2951882b0f31e1aef2457b363590e516511dbb5376cd546e" => :mountain_lion
|
2014-11-02 11:54:34 +00:00
|
|
|
end
|
|
|
|
|
2014-05-30 19:58:04 +00:00
|
|
|
depends_on :ant => :build
|
2015-03-12 01:31:26 +00:00
|
|
|
depends_on :java => "1.7+"
|
2013-10-28 19:44:20 +00:00
|
|
|
|
2010-10-17 00:15:37 +00:00
|
|
|
def install
|
2012-06-09 08:26:31 +00:00
|
|
|
system "ant", "clean"
|
|
|
|
system "ant"
|
2014-07-24 23:04:59 +00:00
|
|
|
libexec.install Dir["*"]
|
|
|
|
bin.write_jar_script libexec/"build/compiler.jar", "closure-compiler"
|
2010-10-17 00:15:37 +00:00
|
|
|
end
|
2015-03-12 01:31:26 +00:00
|
|
|
|
|
|
|
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
|
2010-10-17 00:15:37 +00:00
|
|
|
end
|