homebrew-core/Formula/bazel.rb

50 lines
1.3 KiB
Ruby
Raw Normal View History

class Bazel < Formula
desc "Google's own build tool"
homepage "http://bazel.io/"
url "https://github.com/bazelbuild/bazel/archive/0.1.5.tar.gz"
sha256 "f27d5c354a5ea77e33cd9792442bff7517b4c9a0ce2c06b07f6bd76afb4c64d8"
2015-11-16 22:15:57 +00:00
bottle do
2016-01-12 08:06:14 +00:00
cellar :any_skip_relocation
2016-02-10 14:03:17 +00:00
sha256 "2e850a43faf41b0b87387f4302d13d758235252a7e49c711fe47cb7b82c3141a" => :el_capitan
sha256 "7d7de14b9d1e1f7693b22cf043c2b822c23a869f75bc7dd29b29f86177330b63" => :yosemite
2015-11-16 22:15:57 +00:00
end
depends_on :java => "1.8+"
depends_on :macos => :yosemite
def install
ENV["EMBED_LABEL"] = "#{version}-homebrew"
system "./compile.sh"
system "./output/bazel", "build", "scripts:bash_completion"
bin.install "output/bazel" => "bazel"
bash_completion.install "bazel-bin/scripts/bazel-complete.bash"
zsh_completion.install "scripts/zsh_completion/_bazel"
end
test do
2016-01-01 13:19:40 +00:00
touch testpath/"WORKSPACE"
(testpath/"ProjectRunner.java").write <<-EOS.undent
public class ProjectRunner {
public static void main(String args[]) {
System.out.println("Hi!");
}
}
EOS
(testpath/"BUILD").write <<-EOS.undent
java_binary(
name = "bazel-test",
srcs = glob(["*.java"]),
main_class = "ProjectRunner",
)
EOS
system "#{bin}/bazel", "build", "//:bazel-test"
system "bazel-bin/bazel-test"
end
end