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-09-21 10:52:14 +00:00
|
|
|
url "https://github.com/google/closure-compiler/archive/maven-release-v20150901.tar.gz"
|
|
|
|
sha256 "f969407699516ac0e9c92be077ab5d04f177a5bbb391fd32dd06f029256d43eb"
|
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
|
2015-09-21 22:34:57 +00:00
|
|
|
cellar :any_skip_relocation
|
|
|
|
sha256 "fc38c9cf78a05755c56902bd91140518c8cac8882b96c4720aafdb980313e49a" => :el_capitan
|
|
|
|
sha256 "c10eeaacd57d11f9550854b473bd949aa4bd0b039d8eac4788c1afeebf5e847e" => :yosemite
|
|
|
|
sha256 "a4182e1f6061f795977120b3327b9006fe70ef49e69820282c472a0089382ab0" => :mavericks
|
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
|