blob: 9f5515db125c23d78bf8771f0c41c86b80696fc4 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 | class ClosureCompiler < Formula
  homepage "https://github.com/google/closure-compiler"
  url "https://github.com/google/closure-compiler/archive/maven-release-v20150315.tar.gz"
  sha256 "9e4ad6367913f1b2f3b3a3a9d68dc4779144336b06aa9732dd0a6caca2d83ba1"
  head "https://github.com/google/closure-compiler.git"
  bottle do
    cellar :any
    sha256 "03bf823ee5f71f31c88ed4a412506bb7e0af4eb90f608d89aae86ac0d0828fec" => :yosemite
    sha256 "94a4040f31ff31c318906e6fbf757cf3669b700a9ed07f9d665abbed30444575" => :mavericks
    sha256 "e2609e83ace94265ebbbeeff90e3b2599917375eb5aecaaa694ba2998dea86c6" => :mountain_lion
  end
  depends_on :ant => :build
  depends_on :java => "1.7+"
  def install
    system "ant", "clean"
    system "ant"
    libexec.install Dir["*"]
    bin.write_jar_script libexec/"build/compiler.jar", "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
 |